Governments create law, order and stability in society. They also protect a society against rule by despotism, a scenario in which tyrannical people with power and resources assert their role over people living in an area. Protecting citizens from external threats is another important role of government.
In some parts of the world, governments are run by dictators or small groups of people who control much of what happens in a country. In the United States, the government includes elected officials who are supposed to create and enforce laws that support an infrastructure for the common good. Governments formalize laws and systems based on the ideals and values of the population the government serves.
In some countries, governments have long been run by dictators or tyrannical leaders who simply build up political and military support and seize control of the government for years or decades. A formal structure of government, like the U.S. democracy, prohibits de facto leaders from seizing control by building military might.
When countries have external enemies, it is the government that defends the country and its people. Governments facilitate the military, plan defense strategies, establish budgets for service members and equipment, and make decisions on when to go to war or defend against invading threats.