That is the official political line, but the reality (as always) was much more complex. It also had a significant tribal, multi-racial, and multi-cultural bases, all evidenced in scriptures and the cultural, linguistic, and genetic landscape of the Indian subcontinent (including Pakistan, Bangladish, Nepal, and Sri Lanka). In that respect it's nothing unique even to India - the social structures of most of the world were built on the same basis.
[The] brahmins say: ‘Only brahmins are the highest caste; other castes are inferior. Only brahmins are the light caste; other castes are dark. Only brahmins are purified, not others. Only brahmins are Brahmā’s rightful sons, born of his mouth, born of Brahmā, created by Brahmā, heirs of Brahmā.
Is there evidence that people were able to move between castes before that time?