The medieval feudal system in Europe was fairly simple in theory, but not always so simple in practice.
In theory, the feudal system was a hierarchy with clear chains of loyalty and obligation from the king on down to the lowest peasants. This worked through a series of oaths made between a superior and an inferior. The king was, of course, superior to every other person in the kingdom. In those days, however, the technology and techniques did not exist to allow a king to rule his whole kingdom. So kings had vassals who ran various parts of the kingdom for him. He would give them a fief (an area of territory) that they would control. In return, they would swear to obey him and help him fight when needed and give him some of the income from their fief. These vassals would, in turn, have their own vassals (so they would be both vassals of the king and lords of their own vassals). Those vassals would get their own, smaller, fiefs and would swear a similar oath to their own lord (who was a vassal of the king). There were typically more links in this chain. In this way, everyone from the peasants on up had lords that they were sworn to obey in a chain of command all the way up to the king.
In practice, things weren’t that smooth. There were constant power struggles. People were always trying to take land away from other people by force. Lords would try to enlarge their holdings by fighting other lords. Sometimes, a high lord would feel strong enough to challenge the king. Sometimes, there would be disputes over who should be king and the various lords would take sides.
In theory, feudalism was one clear hierarchy where everyone knew their place. In practice, it was full of scheming and rebellion and was often pretty chaotic.