When India abstained from a United Nations vote and the chorus of Western condemnation against the Ukraine invasion, it appeared to be taking sides: offering tacit support for President Vladimir Putin of Russia.

After all, the two nations’ deep ties are decades old, and their leaders, who have met nearly 20 times since Narendra Modi became prime minister of India in 2014, share a similar vision of muscular nationalism.

But India was more subtle in its move, driven by its vulnerability in a hostile neighborhood that forces the country to play a constant balancing act between Moscow and Washington.