Two states will determine the outcome of the 2019 Lok Sabha election: Uttar Pradesh and Maharashtra. Between them they account for 128 seats in the Lok Sabha. The BJP-led NDA won 114 of those 128 seats in the 2014 Lok Sabha poll. Now India's two biggest states spell danger in Prime Minister Narendra Modi's bid to win a second term.

The alliance between the Samajwadi Party and Bahujan Samaj Party is mathematically irresistible. Together the two parties command over 50 per cent of the state's vote share across Yadavs, Jatav Dalits and Muslims. In 2014, the BJP won 71 of the state's 80 seats; its ally Apna Dal won another two seats, making it an unprecedented sweep of 73 seats. The BSP was wiped out; SP won five "family" seats (the extended Mulayam Singh Yadav parivar) and the Congress its two old fiefs of Rae Bareli (Sonia Gandhi) and Amethi (Rahul Gandhi).

Following the success of their one-off alliance in Gorakhpur and Phulpur, the BSP and SP are certain to join forces for the Lok Sabha poll. Old enmities have been swept under the carpet. The Congress will join the SP-BSP grand alliance to ensure the anti-BJP vote isn't split.

The math looks good on the surface but three factors could dilute the alchemy between the anti-BJP forces. First, seat sharing. To carve out their respective shares from 80 Lok Sabha seats in the state is the first hurdle SP and BSP will face. Seat allocations can be messy and cause serious disruptions between aspiring Lok Sabha candidates.

The second factor is the SP and BSP's vote silos. They are not necessarily fungible. Old resentments between the two cadres remain strong. When campaigning, friendly fights can't be ruled out.

The third hurdle is the danger of reverse consolidation. As UP's voters see old enemies SP and BSP cynically forging an alliance to stop Narendra Modi, with the discredited Congress playing matchmaker, polarisation amidst a Modi vs The Rest battle could set in. Voters know that the SP-BSP-Congress coalition of 2019 will be unviable in the next state Assembly election in 2022. Neither Mayawati nor Akhilesh Yadav will cede the chief ministership to the other in the 403-seat UP assembly. If an alliance for the 2019 Lok Sabha poll is seen as a one-off to stop Modi, it could coalesce the Brahmin, Thakur and OBC vote in favour of the BJP.

And yet, the damage to the BJP's seat tally in 2019 will be significant. In the Gorakhpur parliamentary by-poll last week, the BJP's vote share fell to 47 per cent (from 52 per cent in the 2014 Lok Sabha election). The SP-BSP coalition vote share rose to 49 per cent, edging out the BJP by just over 21,000 votes.

In Phulpur (Jawaharlal Nehru's old constituency), a similar pattern was visible. In 2014, with BSP and SP fighting separately, the BJP had swept to victory with 52.50 per cent vote share. Last week, faced with the BSP-SP alliance, the BJP's vote share dropped to 39 per cent. The BSP-SP combination forged ahead with 47 per cent vote share and won by nearly 60,000 votes.

Uttar Pradesh is not the BJP's only worry. Maharashtra accounts for the second largest number of Lok Sabha seats: 48. In 2014, the BJP-Shiv Sena alliance swept 41 seats. BJP won 23 seats and Shiv Sena 18. An embittered Sena poses a serious challenge to the BJP's chances of repeating its 2014 landslide in the state. It has a dedicated cadre on the ground. In an election, it can be a formidable force. That is why Maharashtra chief minister Devendra Fadnavis swallows the Sena's daily taunts against the BJP. If Shiv Sena contests the 2019 Lok Sabha poll in a loose alliance with the Congress and NCP, the BJP could be in real trouble.

The Sena's Hindutva jars on the Congress and NCP but both will welcome nudge-and-wink seat adjustments with Uddhav Thackeray. The ill-feeling between the cadres of the BJP and Shiv Sena is so strong that the Sena could well ally with sworn enemies like the Congress and NCP just to defeat the BJP.

The Sena's pathological dislike of Modi stems from Uddhav Thackeray's belief that the prime minister has snubbed him repeatedly over the past four years. Growing up under the shadow of his dominating father Bal Thackerary, Uddhav has a thin skin. Besides, the Sena regards itself as the original Hindutva party. The BJP's rise has cut the Sena's vote share in its home citadel. It not only won fewer seats than the BJP in Maharashtra in the 2014 Lok Sabha election (18 against 23) but also garnered just 63 seats to the BJP's 122 in the October 2014 state Assembly poll. It had to cede the chief ministership to Fadnavis.

The Sena is also worried about its hold over the BMC, India's wealthiest civic body with an annual budget larger than some states. The Sena has 84 corporators in the BMC which it runs together with the BJP's 82 corporators. If the BJP's electoral momentum in Maharashtra continues, the Sena could in future be reduced to a small player in the BMC, among the most corrupt and incompetent municipalities in India. The Sena is, therefore, prepared to ally with rivals Congress and NCP in 2019 to weaken the BJP, even though it could mean cutting its nose to spite its face, in order to maintain its hold on the BMC's cash machine.

The BJP meanwhile is in binary contests with the Congress in five big states: Gujarat, Rajasthan, Madhya Pradesh, Chhattisgarh and Karnataka. Together, they account for 118 Lok Sabha seats. In 2014, the BJP won 105 of those 118 seats. Given strong anti-incumbency, that tally too is set to fall.

The math is stark. Seven states gave the NDA 219 of its 282 Lok Sabha seats in 2014: UP 73, Maharashtra 41, Gujarat 26, Rajasthan 25, MP 27, Chhattisgarh 10 and Karnataka 17. The extent of losses from these seven states will make or mar Modi's bid for a second term.

The northeast, Odisha and the south will deliver additional seats to the NDA but nowhere near enough to make up for the losses in the seven key states which, led by UP and Maharashtra, will decide the outcome of the 2019 Lok Sabha election.

Also read: India is witnessing a silent rage. The key to unseating Modi lies in a unified Opposition