Was the caste system in India ever based on "merit"? If so, when did it become hereditary?

by onyx314
MaharajadhirajaSawai