Feudalism, although functional, was not a major element of Charlemagne's empire; in fact, under Charlemagne's rule, the Empire was largely intact and feudalism was practically non-existent. The change came about after the death of Charlemagne when his Empire was split apart by his grandsons, and more importantly by invasions from the Magyars and Vikings. The Vikings were a particularly problem. Because they traveled in boats which set high in the water, they were able to travel upstream and attack suddenly in areas where they were not expected. Their sudden arrival meant that traditional means of defense (an army operating under officers ultimately responsible to a governmental official) would not work. It was necessary that defense, and therefore governance, be a local issue. This gave rise to homage and fealty, whereby a lesser lord pledged loyalty to a greater lord and promised to fight for him. Those nobles pledged to protect their lord's territory were commonly known as bellatores (those who fight.) It must be emphasized that this happened after the collapse of the Carolingian empire, and only at the onset of Viking and Magyar invasions.
This system worked much more clearly in theory than it did in practice.
In theory, this system was one in which every person owed clear allegiance to those above them and responsibility to those below. A knight or other low-level member of the elite would own a manor bestowed upon him by his lord. He would be lord of that manor and run it for his own good. He would then owe military service to his lord. His lord, in turn, would have a similar relationship with a lord above him and so on up to the monarch.
In practice, things were not nearly this neat. The main difference between theory and practice is that, in practice, the various vassals were not nearly as loyal to their lords as they were supposed to be. The more powerful members of the nobility would often be in conflict with their monarchs and would be strong enough to be able to resist the monarch's desires or even to conspire to overthrow him.
In theory, then, this system was a well-ordered and hierarchical system. In practice, it was one in which loyalty was shown mainly when it was in the interest of the vassal to do so.