After the Roman Empire declined, Western Europe had no countries. Numerous tribes fought for domination over territories, but there were no central governments or national armies. The Frankish tribes set up control over vast territories, and one Frankish king, Charlemagne (Charles the Great) ruled a considerable chunk of Europe -- from northern Spain and Italy through France, Germany and Poland. To control such a substantial territory, Charlemagne instituted a feudal system of government. In feudalism, the king owned all of the land.
The king granted fiefs (portions of land) to nobles (lords or barons) in exchange for loyalty, protection and service. The king could also offer fiefs to vassals (knights) in return for military service. Many knights were professional warriors who served in the lord's army. In return, the lord provided the knight with lodging, food, armour, weapons, horses and money. Peasants, or serfs, farmed the land and provided the vassal or lord with wealth in the form of food and products. The peasants were bound to the land, so it was in the vassal's interest to protect them from invaders. Fiefs -- and the obligation to serve the king -- were inherited by the eldest son of the ruling nobleman.
Feudalism allowed large territories to be governed in the absence of a central government. Each lord or vassal raised an army to defend his fief and to serve the king as needed. One drawback to this system was that the nobles were very powerful because they controlled the armies. In fact, nobles often warred amongst themselves over territories.