RISING on the south bank of the Ganges, Patna is a mix of new and old: glass-faced IT training-centres and bamboo-canopied rickshaws. Right now the capital of Bihar is thrumming with an electoral battle for control of India’s third-most-populous state. Enormous images of India’s prime minister, Narendra Modi, glare from saffron-coloured billboards over the grimy streets. Nearby the titans of the local rough-and-tumble politics answer him with slogans printed across billboards of yellow, green and red—fists raised in defiance.

The election for the state assembly kicked off on October 12th. It will continue in five phases over the next month, with the final result tallied on November 8th. Above all, it is a test for Mr Modi (some of whose supporters in Bihar are pictured above). For all his prestige in Delhi, the capital, his Hindu-nationalist Bharatiya Janata Party (BJP) and its friends control only two-fifths of India’s states, where power often lies. He has set his heart on dominating them. If Mr Modi can make it in Bihar to the east with its more than 100m people, or nearly 8% of the population—he can make it anywhere.

When Mr Modi swept to office in May 2014 he redefined national politics, taking an unprecedented 282 seats of 543 for the BJP. He ran a presidential-style campaign, aroused voters’ hopes with a story of economic development and fulfilment of personal dreams, and scored majorities in every region of the country. Yet opposition in the upper house, whose composition is largely determined by the balance in states, has checked his promised reforms, notably a land-acquisition bill and a national goods-and-services tax. In February the BJP suffered a startling defeat to an upstart party in the assembly elections for the territory of Delhi. Of four states due to vote in 2016, none can be expected to elect a BJP-led government. So Bihar matters. If Mr Modi’s wave ebbs here, he and his fearsome political strategist, Amit Shah, will face a hard reckoning.

The BJP has stiff opposition in Bihar. The most prominent opponent is Nitish Kumar, the incumbent chief minister, who came to office in 2005 with the BJP backing his Janata Dal (United) party. Their coalition was fruitful and Mr Kumar was re-elected comfortably in 2010. Mr Kumar broke the alliance in 2013, saying Mr Modi was responsible for an anti-Muslim pogrom in Gujarat 11 years earlier when he was chief minister there. Yet both men ran their states in similar fashion, stressing development. Long a byword for poverty, Bihar’s double-digit growth rate has routinely surpassed that of wealthier Gujarat.

But the wild card in Bihar’s polls is a former enemy-turned-ally of Mr Kumar, “Lalu” Prasad Yadav. Wildly charismatic, Lalu was among the first chief ministers to make a virtue of coming from one of the “other backward classes”, as defined by the government, which are guaranteed quotas in higher education and public service. He promoted the interests of his Yadav caste, who are traditionally cow-herders. He held office for 15 lawless years, sometimes by proxy while under criminal investigation for corruption. The period was derided as the “jungle raj”. While the rest of India flowered, Bihar withered. Lalu’s misrule laid the groundwork for Mr Kumar’s technocratic turnaround. The two have now joined forces. With a rump from the Congress party, they form Bihar’s “grand alliance”.

Mr Kumar and Mr Modi both hope to win voters with promises of betterment through economic growth. But their choice of coalition partners is also driven by low-minded calculations of caste and religion. As in other states, the BJP’s natural supporters are upper castes. But the party’s coalition, the National Democratic Alliance (NDA), also includes groups representing the most disadvantaged Hindus, the Dalits or those formerly considered “untouchable” (see chart).

Mr Kumar’s grand alliance appeals more to the middle of the caste hierarchy, including most of the “other backward classes”, who are probably the majority of the population. Most Muslims, who are 17% of Bihar’s population, see the BJP as a party of Hindu chauvinists. They generally plump too for the grand alliance.

Electoral wrestling can turn ugly. Lalu has managed to keep his fellow Yadavs aligned with the Muslims in his Rashtriya Janata Dal (RJD) party, giving him a powerful store of votes. The NDA needs to lure swing-voting Hindus away from the grand alliance. They have arguments on their side: look how well all the BJP-led states have fared, and consider how Lalu would make any coalition unstable. But the fact is that a cruder tactic—driving a wedge between Hindus and Muslims—could also help the BJP, as it did in parliamentary elections in next-door Uttar Pradesh (UP), India’s most populous state, in 2014.

A gruesome reminder of communal tensions was the lynching on September 28th of a Muslim man in UP. He was accused by a Hindu mob of having slaughtered a calf (cattle are sacred to Hindus) and eaten its meat. Some BJP politicians jumped to make inflammatory remarks in sympathy with the killers, and a nationwide row ensued, with further violence.

The lynching—and the reaction to it—generated national alarm. Yet the prime minister stayed silent for eight days. When Mr Modi finally spoke, it was to offer a vague homily and later to call it a “sad” incident. With his eye on Bihar, some say, he wants to encourage cattle-revering Yadavs to see themselves as Hindu first and foremost. In protest at the Modi government’s apparent insouciance, dozens of Indian writers have returned their national awards. The Bihar election is coming to matter as much to India as a whole as to the state itself.