The seed of Russo-Indian friendship was probably sown during Jawaharlal Nehru’s visit to Soviet Russia in 1928, when he was greatly enamoured by the Soviet model of development, which helped turn a primarily agricultural economy into an industrial one in such a short period of time and resolved to pursue the same development model in India too. There were other connections with Soviet Russia in colonial India, mainly through Communist Party of India and its leaders like M.N. Roy.
But the real friendship between the two countries started after the death of Joseph Stalin in 1953. Stalin, to be sure, had little time for a nation like India and with the knowledge of Stalin’s purges being public by then; a democrat like Nehru too was not very willing to embrace Stalin, even though he adopted the planning mode of development, a brainchild of Stalin. General Secretary Nikita Khrushchev and Premier Bulganin visited India in 1955, their first visit to a non-Communist nation, setting the ball rolling for a very enduring relationship.
The Indo-Russian relationship developed and endured for mainly three reasons: geopolitical, economic and domestic.
Geo-politically, India needed Soviet Union in order to blunt US’s support to Pakistan, counter the US-China-Pak axis which developed post-Bangladesh, support in Security Council on Kashmir issue, prevention of US dominance of the Indian Ocean etc. For Soviet Union too, India’s support had high currency as it was the only democratic country which had supported it in the Hungary crisis in the UN.
Economically, the aid from the Soviet Union was very crucial in the early economic development of India. While the aid from the (capitalist) West was not forthcoming and even when it was, it had stringent conditions attached to it; Soviet Union was generous in its economic as well as military aid/supplies to India.
The domestic politics in India too was conducive to closer ties with Russia. There was near-unanimity on closer ties with Soviet Union across all parties, with the probable exception of Swatantra Party. In order to secure an alliance with CPI after she was ousted from Congress and was reduced to minority in the Parliament, India Gandhi assiduously forged close ties with the Soviet Union. KGB too helped Indira Gandhi keep tab on the opposition she faced within the country.
There was a decade-long freeze in the relationship after the disintegration of the Soviet Union in 1991. But this freeze was ended in 2001 when the then Indian Prime Minister A.B. Vajpayee and Russian President Putin signed 80 bilateral agreements under the Indo-Russian Strategic Agreement. Since then, India and Russia have enjoyed a warm relationship, on account of, among other things, a shared vision for a multi-polar world.