From time immemorial India have been home to people of religious affiliations different from the majority. They lived at peace with each other except for brief spells of despotic rulers . So modern India was projected as a shining example of Secularism by the post independence elite . But the rise of Hindu Nationalism has shattered this false narrative and exposed the hollowness of these claims . The secularism they projected was nothing but the caste system , where every community occupied different slots in a hierarchy and lived accordingly. But emancipation of Dalits and other backward castes have distorted the caste hierarchy, leading to a Hindu consolidation, which is often interpreted as Majoritarianism.
With each wave of migrants starting with the Indo Aryans , the Indian society started to delegate itself into various stratas. Though endogamous in theory they mixed with existing society creating a hybrid one. Varna hierarchy gave way to jati where every jati had a unique position. With Brahmins at the top and Dalits at the bottom newer immigrants started finding places in between. For example In Kerala Syrian Christians where placed at par with higher caste of Nairs , making them practice untouchability with respect to lower jatis . In North India too after the initial turmoil post the Islamic invasion, as the storm settled during Mughal period , the ruling class of Turks , Iranians and Afghans were given status at par with kshtriyas (though never acknowledged). The middle strata got identified with intermediate castes and some with lower castes .
So, till the British rule the Indian society was a mosaic of castes of varying beliefs. Thanks to Indologists Hinduism was designated a separate religion and foreign religions were declared alien to the land . With Independence , things were supposed to go back to its original state and the elite wanted it that way . But thanks to work of visionaries like Ambedkar the lower castes started to assert themselves and they started questioning their position in the caste hierarchy with respect to foreigners. The Intermediate castes were more virulent and made a common cause with the higher castes leading to Hindutva coming to power in 2014 . Now with the active agenda of RSS bearing fruit , jati system is slowly being demolished and Hindus are identifying themselves more on the basis of religion than caste.
Caste being irrelevant the hierarchy also became worthless. This made the old sense of secularism go up in flames . Now it is Hindus vs the rest or Indians vs the foreigners.