As others have mentioned, feudalism began as a response to the break up of the Roman empire. While the Romans were in charge, the vast expanse of the empire was one of the safest places in the world. Nobody dared challenge the might of the Roman legions, and inside the Empire, people could travel with relative ease on an extensive network of roads. This aided commerce and the spread of ideas: the rapid spread of Christianity, for example, is credited, in part, to the safe and efficient travel the Romans made possible.
As the Roman legions began to withdraw and the Empire crumbled, lawlessness began to reign. This chaotic situation was no good to anyone, except perhaps the raiding Vikings and the criminal classes—but even they could not prosper long without goods being produced, crops grown, and commerce enabled. The territories of the former Empire needed a new system.
Nobody was strong enough to impose the kind of centralized government the Romans had been able to institute. Therefore, smaller communities formed around a new social contract in which a warrior class was granted leadership power and a portion of the region's wealth in return for providing the rest of the people with protection. This system of mutual obligation was called feudalism, and for centuries, it effectively filled the void caused by the empire's collapse.
Feudalism was land- or territory-based. The lord owned a large piece of land and derived his wealth from the food, goods, and, later, cash rents paid to him by his tenants in return for his military protection.
Feudalism started in Europe after the fall of the Roman empire to solve the problem of law and order. There were no kings strong enough to rule over large areas at that time, and society needed to create a labor system with which to get things done. In feudalism, the lords controlled the land and the peasants who lived there. The lords provided protection to the serfs in terms of knights. Sometimes, peasants could also be called on to fight wars, but this was quite rare. Peasants worked the land and provided part of the harvest to the upkeep of the lords and his loyal knights. The system was based on a hierarchy of loyalty. Above the lords there were other levels that went up to kings, and kings received their authority from God as they were God's appointees to govern secular affairs on Earth. Peasants did not have time to consider secular affairs outside of their village and much of their life was consumed with honoring the lords and the Church and ensuring that work was done.
Feudalism began around the 8th century. However, it really began to develop around the 10th century in Europe. The King would give land to the nobles. The nobles agreed to protect the King if war or fighting occurred. The nobles had serfs who would work for them. The serfs took care of the land the nobles controlled. The serfs allowed the nobles to protect and rule them. The serfs were on the lowest level of the social ladder. They really didn’t have rights.
The feudal system developed after the fall of Rome. During the Roman Empire, the government provided protection to the people. However, after the Roman Empire fell, there was little protection available for the people. As a result, people turned to the lords to protect them. The feudal system began because with no strong central government to protect the people, they needed a system where they would feel safe.
Feudalism arose in Europe because of the need for a way to pull society back together after the Roman Empire collapsed in the West. Feudalism drew on older traditions of Germanic peoples to create order out of the chaos that followed the end of the Western Roman Empire.
After the Roman Empire fell, there was no longer a strong, centralized authority in Western Europe. This meant that society sort of fell apart. In reaction, people fell back on earlier ways of doing things. Specifically, they fell back on the idea of personal bonds between the leaders and their followers. This led to feudalism.
In feudalism, a leader “owned” the service of his followers. They had to help him militarily whenever he asked. In return, they were given power over certain areas of land. They got the produce from that land and they ruled the people who lived on that land. They swore to support their lord militarily and their lord swore to protect them.
This system arose because no one was really strong enough to do more. Kings and other leaders were not strong enough to control large areas directly. The lower lords were not strong enough to keep themselves safe without help. Both sides needed each other and so the feudal system arose.