You are thinking in terms of extremes. Relations are not black or white, not every nation has to be either an, "enemy," or "friend." China can recognize the geopolitical realities that would prevent India from being a "friend," but it is still in China's interests to prevent India from being an, "enemy." Whenever possible, you want to avoid making your neighbors, especially big ones, your "enemies." India for the most part has resisted direct alignment with the West, and it is in China's interests that India continues to do so. Adopting a hostile policy towards India only increases the probability of India drifting closer to the West. It is also not in any country's interest for a large neighbor to collapse and descend into chaos, especially if that large neighbor has a nuclear arsenal (regardless of how small and basic that arsenal may be).