Understanding the Indian caste system as an outsider
India's caste system is, of course, unique in the way all national institutions are unique. But it is far from the only caste system and it is not so different as is usually supposed. There were similar and contemporary systems in China, Korea, Japan, pre-Christian Igbo and Mande societies... And as for historical precedent, there are even more. Nor is India's system unique in surviving on a social level. If anything, it's unique because the government of India has taken such strident measures to counteract it in a democratic context. For example, Japan has a caste of untouchables and they are still discriminated against.
So the premise of your question is flawed. As is the idea that Islam, Christianity, and Sikhism couldn't affect the caste concept. While it didn't eliminate it completely, the way a Christian, Muslim, or Sikh experiences and conceives of the caste system is radically different than a Hindu. This is even true for Buddhists. And generally Sikhism and western Christianity is considered to have strong anti-caste sentiment and is attractive to certain castes as a result.
Why did it exist and with such elaboration? The British. (This is also why it's common even to religions that reject it: the British didn't exclude Christians or Muslims etc.)
The modern caste system was created by the British in 1881. Now, the British did not invent the concept of caste or that it was a system or invent any castes or ethnic groups. What they did do was conduct a census where every single person was categorized by caste, religion, and ethnicity. For the first time ever there was a coherent, India-wide system of castes with different ranks and laws applying to them. At least in British territory: the princely states could be more varied.
It's controversial if the British made any modifications to the census for political purposes or if they simply accurately reported what they were told. What is not controversial is that they prevented people from changing caste and created laws that applied by caste. This system, whereby there were different laws for different castes, persisted with modifications until 1948.
To transport it to an American context, imagine America is being colonized by Britain (again) except we're an alien people and they don't really understand us. (Okay, that's not so hard.) Now, you have racial, religious, work-based, and other conceptions of yourself. You may or may not believe you can leave some, all, or none of them. Their importance varies vastly depending on location and how they interplay. The system is complex and more than a little chaotic and it varies from state to state.
And the British don't understand it. So they send out a bunch of census takers. Alright, a census taker is knocking on your door. Now, what are you?
You're a mixed race Democrat living in Albany and working as a school teacher named Gloria van der Wafel? What races? White and black? Oh, well we've decided that if there's a mix you count as white. Also, from your name and the place you live you're obviously Dutch. And you're a member of the school teacher profession? Have you worked in it your entire life? Great, that makes things easier. Okay, I've got what I need. No, I don't need to know what your religion is: we've discovered there are no real differences among Americans due to religion. Silly you.
Anyway, here's what you are. Now, we've decided White Americans aren't very good at running things so you'll be forbidden from holding any kind of high office. However, you're a Dutch White American and we know the Dutch caste are really good at fighting so you can become a high ranking soldier if you join the army. Also, you and your children will put into the 'school teacher' class which will be allowed to teach school or do related work like being a secretary or coal mining. We've determined the skills and predilections of your profession make you ideally suited for that. And lastly, because you're a Democrat, you'll be paying a special Democrat tax. Also, you can't go to New York City anymore. But you can move to Buffalo or visit (but not move to) Boston.
Oh, and your neighbor has been determined to be of a criminal caste. Canadians, you know. Can't trust them. So we've arrested him and are currently rifling through his stuff to find evidence of his crimes. Don't worry, it won't happen to you. You're Dutch and the Dutch aren't predisposed to crime!
Toodles, spot of tea, what what. (And yes, they really did have things like that.)
Did the British invent the concepts like 'black' or 'white' or 'Dutch' or 'Canadian'? No. You would have articulated your own systems and rules before they showed up. Were there no laws or customs or beliefs about any of this before? No, there were. But despite that, the situation is rather different now, isn't it? And your place in society is now explicitly and entirely reliant on these classifications. Which are all unchangeable, by the way, and recorded in a very official looking office. And the rules are now made by the British, beyond your control. This was the effect of the British census and their use of it to rule India. And this was not particularly unusual, by the way. The British undertook similar measures in other societies. And more widely, the ossifying of social boundaries through censuses is a fairly common part of projects to make the population legible to central authority, even in non-colonial regimes.
So was there anything unique? Well, yes. Orientalism meant there was a far greater interest in the Indian caste system and the 'ancient wisdom' of their society. This made westerners far more aware of it than they are about caste in (say) Nigeria. But sociologically or in imperial terms? Not really, no.
From Society, and Politics in India from the 18th century to the Modern Age, the Making of the Raj, Castes of Mind: Colonialism and the Making of New India, The Peasant and the Raj, and Religion and Personal Law in India