Rived by caste as well as class divisions, and dominated in Bollywood as well as politics by dynasties, India is a grotesquely unequal society. Its constitution, and much political rhetoric, upholds the notion that all individuals are equal and possess the same right to education and job opportunities; but the everyday experience of most Indians testify to appalling violations of this principle. A great majority of Indians, forced to inhabit the vast gap between a glossy democratic ideal and a squalid undemocratic reality, have long stored up deep feelings of injury, weakness, inferiority, degradation, inadequacy and envy; these stem from defeats or humiliation suffered at the hands of those of higher status than themselves in a rigid hierarchy.

I both witnessed and experienced these explosive tensions in the late 1980s, when I was a student at a dead-end provincial university, one of many there confronting a near-impossible task: not only sustained academic excellence, but also a wrenching cultural and psychological makeover in the image of the self-assured, English-speaking metropolitan. One common object of our ressentiment — an impotent mix of envy and hatred — was Rajiv Gandhi, the deceased father of main opposition leader Rahul Gandhi, whom Mr. Modi indecorously but cunningly chose to denounce in his election campaign. An airline pilot who became prime minister largely because his mother and grandfather had held the same post, and who allegedly received kickbacks from a Swedish arms manufacturer into Swiss bank accounts, Mr. Gandhi appeared to perfectly embody a pseudo-socialist elite that claimed to supervise post-colonial India’s attempt to catch up with the modern West but that in reality single-mindedly pursued its own interests.

There seemed no possibility of dialogue with a metropolitan ruling class of such Godlike aloofness, which had cruelly stranded us in history while itself moving serenely toward convergence with the prosperous West. This sense of abandonment became more wounding as India began in the 1990s to embrace global capitalism together with a quasi-American ethic of individualism amid a colossal population shift from rural to urban areas. Satellite television and the internet spawned previously inconceivable fantasies of private wealth and consumption, even as inequality, corruption and nepotism grew and India’s social hierarchies appeared as entrenched as ever.

No politician, however, sought to exploit the long dormant rage against India’s self-perpetuating post-colonial rulers, or to channel the boiling frustration over blocked social mobility, until Mr. Modi emerged from political disgrace in the early 2010s with his rhetoric of meritocracy and lusty assaults on hereditary privilege.

India’s former Anglophone establishment and Western governments had stigmatized Mr. Modi for his suspected role — ranging from malign indifference to complicity and direct supervision — in the murder of hundreds of Muslims in his home state of Gujarat in 2002. But Mr. Modi, backed by some of India’s richest people, managed to return to the political mainstream, and, ahead of the 2014 election, he mesmerized aspiring Indians with a flamboyant narrative about his hardscrabble past, and their glorious future. From the beginning, he was careful to present himself to his primary audience of stragglers as one of them: a self-made individual who had to overcome hurdles thrown in his way by an arrogant and venal elite that indulged treasonous Muslims while pouring contempt on salt-of-the-earth Hindus like himself. Boasting of his 56-inch chest, he promised to transform India into an international superpower and to reinsert Hindus into the grand march of history.

Since 2014, Mr. Modi’s near-novelistic ability to create irresistible fictions has been steadily enhanced by India’s troll-dominated social media as well as cravenly sycophantic newspapers and television channels. India’s online population doubled in the five years of Mr. Modi’s rule. With cheap smartphones in the hands of the poorest of Indians, a large part of the world’s population was exposed to fake news on Facebook, Twitter, YouTube and WhatsApp. Indeed, Mr. Modi received one of his biggest electoral boosts from false accounts claiming that his airstrikes exterminated hundreds of Pakistanis, and that he frightened Pakistan into returning the Indian pilot it had captured.

Mr. Modi is preternaturally alert to the fact that the smartphone’s screen is pulling hundreds of millions of Indians, who have barely emerged from illiteracy, into a wonderland of fantasy and myth. An early adopter of Twitter, like Donald Trump, he performs unceasingly for the camera, often dressed in outlandish costumes. After decades of Western-educated and emotionally constricted Indian leaders, Mr. Modi uninhibitedly participates — whether speaking tearfully of his poverty-stricken past or boasting of his bromance with Barack Obama — in digital media’s quasi-egalitarian culture of exhibitionism.