In ancient times, Hindu caste system was based on occupation. The castes and sub -castes names defined occupation, eating habits, rituals and behaviors. The people belonging to the caste systems excelled in their trade and developed niche ways of keeping them in their trade. Main castes (Varna - literal means Class, order or profession ) include Brahmin (Priests, Teachers, Learned ones), Khatriya (Warrier, Ruler, Protector), Vaishya (Traders), Shudras (Servants, Cleaners, Service providers etc). The texts do not claim higher or lower in any way among those, but emphasises needs for all 4 in a perfect society. It was medieval times, the entire aspect of well weaved system was turned to provide benefit to some, and those ideas prevailed. In each of the four high level caste categories, sub categories evolved called subcaste systems ( Jatis, literally Class differentiator) that provided further detailed based on specialized occupation.
Occupation was the one determining factor for caste, and allowed people to move in different castes based on their achievment, talent and perseverance. Several examples of that, included a Kshatriya (a Warrier or ruling protector class) like Vishwamitra, to become a Brahmin based on his penance. Other scenarios explained, Sage Parashuram (a Brahmin from Bhargava Clan) entering into armed combat with Kshatriyas to revenge his father's assasination by Kshatriyas. His father Sage Jamadagni was killed by Kartivirya Arjuna.
Over the times, the need for keeping the trade secrets within the close community of caste/ sub-caste, the rituals and traditions were evolved. These traditions involved "Marriages within same caste", "Adoption rules", "Inheritence rights" etc. The texts described and prohibited practice against those traditions.
The Hindu caste system is a division of the population in relation to their social class as well as occupation. There are four divisions of the caste system; the Brahmins, the Kshatriyas, the Vaishyas and the Shudras. The Shudras belong to the lowest caste, and it consists of the laborers or the poor people in the society. Vaishyas are the merchants who engage in business and the Brahmins are the religious group.
Ref : http://www.ask.com/question/explain-the-hindu-caste-system
The caste system which is prevalent in Indian culture refers to a social stratification and restrictions placed on some groups within the society. The system has been traditionally associated with Hinduism, however, many other religions in the Indian society, Muslims and Christians included. The practice of discrimination based on the caste system has been outlawed by the secular socialist democratic government by way of their Constitution. You can find more information here: http://en.wikipedia.org/wiki/Hindu_caste_system
Ref : http://answers.ask.com/Society/Other/what_is_the_hindu_caste_system