The Chinese have traditionally divided the outside world into two parts: vassal states and barbarians. India doesn’t fit in that narrative; like China, it is a great civilization with an enormous population that suffered the yoke of colonialism and has nuclear weapons. It actually exported part of its culture (Buddhism) to China, rather than the other way around. The two differ, however, in that the impacts of colonialism were more widespread in India, India is far more chaotic and democratic than China, and the Indian economy is based on agriculture and services, not manufacturing.
Analogies are never perfect, but I think it would be fair to say that the relationship between China and India resembles in some respects the relationship between Germany and Italy. Geographically, India looks a lot like a much larger version of Italy: a peninsula with mountains protecting its northern border.
The rise of China, and its increasing assertiveness abroad, has inevitably led to a closer connection between the US and India. If the Chinese blunder their way into encirclement, India (with some reluctance) will be the key player. China and India may well be the most important big power rivalry in the 21st Century.