The European class system is essentially what transformed into the Indian caste system.
Not to mean there was no social hierarchy in India, but the rigid birth based system we have today is the handiwork of the British social engineering.
Especially interesting is the population survey which labeled population with a caste, the power to label someone X lay with the enumerator rather than the person being enumerated self identifying with a caste.
Excerpt:
The British Raj furthered this development, making rigid caste organisation a central mechanism of administration. Between 1860 and 1920, the British formulated the caste system into their system of governance, granting administrative jobs and senior appointments only to Christians and people belonging to certain castes.
[1] https://socialsci.libretexts.org/Bookshelves/Sociology/Intro...
To justify the "pre-date", proponents combine highly distorted theory of jatti and varna to artificially synthesize Indian caste system.
The connection of caste with Europe is much more solid and meaningful given the monopoly of church over God and the king as the representative of God.
That is not true. Caste endogamy goes back a long ways[1] before the Brits.
1. https://www.brownpundits.com/2018/06/07/genetical-observatio...
This is a better and more holistic description. I'd quibble withs some aspects of its framing but it's mostly nitpicks. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3514343/
The gist of it is that there are a lot of discrete, endogamous subgroups within India formed by successive waves of migration by different groups to where they are functionally distinct ethnic populations. So it wouldn't be all that different from racial differences in a plural society like the United States. What's remarkable is the maintenance of this plurality, as well as in-group social norms, over a very long span of time rather than it becoming a genetic melting pot as we might have expected from experiences with Europe. But even there you still have distinct groups with strong endogamy norms (e.g. Ashkenazi Jews).
There's also additional complexity because in many places there isn't just a norm of endogamy, but consanguinity (cousin-marriage). Which is certainly going to make groups look more endogamous even though it would lead us to draw subtly different conclusions about what that means in terms of historic cultural norms.
TL;DR it's a really complicated matter that doesn't lend itself to summarization into a single, clean, generalizable narrative.
[1] https://indianexpress.com/article/india/kerala-dalit-priests...