Caste systems and class systems

Define caste systems and class systems. How do they differ? How does the concept of meritocracy fit in to this distinction? How is each type of system related to a different stage of economic development?