If you are talking about Western Europe during the Middle Ages after the fall of the Roman Empire, there are several ways that the people of the times managed to maintain some sense of stability. First, the church took over much of the power vacuum left by the fall of the Roman Emperor. Monasteries helped to maintain stability in rural areas, and Bishops became powerful secular authorities as well as religious authorities within cities. With the lack of a central political power, a complex network of relationships developed to maintain both the military and the economic sectors of Western Europe. The feudal system of relationships between knights and Lords in return for land or other financial support helped larger landowners protect their land. A complementary system called manorialism was developed to protect and utilize the crops grown on the land. In this system, peasants farmed for the Lord on his land in return for land to farm on their own as well as protection from outside invaders. The system was actually a hodgepodge of duties and responsibilities for both sides. Eventually, a system of nation states grew up and replaced both the feudal and manorial systems resulting in the nations of Europe that we know today.
When the Roman Empire fell, it brought Western Europe into a period of widespread chaos and death. There was no one to maintain order and stability, with the absence of a durable centralized empire of the past. Since then, the Celtic tribes raided villages and killed many people, bringing in its wake suffering and pain. Also, the fall of Rome and its aftermath led to the people's loyalty to the empire come into question. Soon, those were kept in check when the feudalist society took hold of the country, regaining Western Europe's stability.
A feudalist society is one which is hugely dominated by a huge network of mutual relations with other nobles of different ranks. This feudal system benefited the warriors, which enabled them to acquire huge armies without the need to own the land or a royal title to their ranks. The feudal system provides peace, stability and harmony in the Middle Ages and also aided in the development of political centralization in the region.
The rise of Christianity played an important role in the rebuilding of Western Europe. It was one of the most significant cultural revolution in the Western Europe. Christianity taught the world that our earthly existence was just a preparation stage for life after we die (afterlife). The church took supreme control over whatever political vacuum left behind by the demise of the Roman Empire. Bishops took control of all these Christian churches. Christianity became the favored religion under Constantine's rule. The monastic movement also played a part in spreading Christian ideologies, and during that time, build monasteries to support its cause. The monasteries gave a powerful appeal to the West, so spreading the influence of Christianity and at the same time, made Western Europe socially stable and secure.