The Medieval social system was based on a hierarchy in which each individual had obligations of loyalty and service to those above him and required such loyalty and service from those below him. Much of the service delivered by the nobles was military in nature. Thus, the serf yielded a portion of his crop and labor to his lord, receiving, in return, protection and government. The lord, in turn, owed military service to his overlord, in return for which the overlord was obligated to come to his defense. And so it went, right up to the king, who dispensed justice and gave protection to all those beneath him, whilst being obliged to God to govern justly and chivalrously. Within this hierarchy there were essentially three major social orders: the clergy, the nobles, and the commons, each of which served a distinct function within society. Thus, the clergy were obliged to protect the moral tone of society and dispense the benefits of religion, while the nobles provided for the governing and protection of society, and the commons paid for it all with labor, money, and goods. This picture of Medieval society is, of course, an oversimplification, but is, nevertheless, essentially accurate.