That depends on your beliefs. People who believed in caste systems definitely believed it's not random.
It might be random. Nobody guarantees is uniformly random.
It might be random. Nobody guarantees is uniformly random.