Could you show me some verses of the scripture explaining it?
In the Bhagvad Gita, Supreme Lord Krishna says:
cātur-varṇyaḿ mayā sṛṣṭaḿ
guṇa-karma-vibhāgaśaḥ
tasya kartāram api māḿ
viddhy akartāram avyayam
According to the three modes of material nature and the work associated with them, the four divisions of human society are created by Me. And although I am the creator of this system, you should know that I am yet the nondoer, being unchangeable. [B.G. 4.13]
Also, technically isn't everyone under a Varna System. It is just more divided by professions which you could categorize into larger groups under Varna System. The System itself is just there so it is not really pertaining to religion then. Human Beings naturally make societal groups like society of Engineers and society of Doctors... So what involvement does Religion have, does it promote it?
I will confuse you again now!
Ashrama system is a sub-set of the Chaturya Varnayam (class system, which is sometimes referred to as caste system). There are 4 Varnas and there are 4 Ashramas.
Originally, member of each Varna was supposed to live their life in according to the four Ashramas. That is where religion fits in.
For instance, a person is determined to be a Brahmana on the basis of his merit.
Once a Brahmana, he is supposed to live his life in 4 Ashramas of 25 years each, assuming he has a life span of a 100 years;
Ist Ashrama would be Bramhacharya: 25 years: This is when the person studies material and spiritual sciences under a Bonafide Guru and observes celibacy.
2nd Ashrama would be Grahastha: 25 years: This is when the individual would enter into a house-holder life allowing him regulated sense-gratification.
3rd Ashrama would be Vanaprastha: 25 years: Now the person would lead a detached life, withdrawing from the material possessions.
4th Ashrama would be Sanyasa: 25 years: Now the person would renounce all - family, possessions....everything and shall live totally depending on Supreme Lord for his sustenance and maintainance.