India and China each have populations of about 1.4 billion. (The United States is a distant third with 340 million people.) The animated graph below compares the differences in gross domestic product (GDP), year-by-year, from 1961 to 2022.
China started out slightly in the lead, and for almost 30 years, the countries were roughly matched. In 1987, India's GDP briefly exceeded China's. But after that, China's GDP skyrocketed. According to Wikipedia, "China's economy grew at an average rate of 10% per year between 1990 and 2004, which was the highest growth rate in the world."
In 2023, China's GDP was $17.94 trillion. India's GDP for 2022 was $3.39 trillion.
Why the disparity? This 2014 World Bank article, "How Has China Outpaced India?" explains what happened:
While economic reforms might explain some of the differences, China outpaced India because (1) the economy was privatized faster; (2) prices were released faster; (3) the labor market underwent much deeper reforms; (4) the economy was opened up to international trade and foreign direct investment (FDI) faster and to a greater extent; and (5) the state's fiscal position was drastically limited, and fiscal competition among China's provinces was introduced.