Why do governments exist? One major reason is that they create rules. But what rules are necessary or desirable? That is open to question, and different types of governments have certainly created a wide variety of rules.
Governments almost certainly originated with the need to protect people from conflicts and to provide law and order. Why have conflicts among people happened throughout history? Many people, both famous and ordinary, have tried to answer that question. Perhaps human nature dictates selfishness, and people inevitably will come to blows over who gets what property or privilege. Or maybe, as Karl Marx explains, it is because the very idea of "property" makes people selfish and greedy.
Whatever the reasons, governments first evolved as people discovered that protection was easier if they stayed together in groups and if they all agreed that one (or some) in the group should have more power than others. This recognition is the basis of sovereignty, or the right of a group (later a country) to be free of outside interference.
A country, then, needs to not only protect its citizens from one another, but it needs to organize to prevent outside attack. Sometimes they have built Great Walls and guarded them carefully from invaders. Other times they have led their followers to safe areas protected by high mountains, wide rivers, or vast deserts. Historically, they have raised armies, and the most successful ones have trained and armed special groups to defend the rest. Indeed in the twentieth century, governments have formed alliances and fought great world wars in the name of protection and order.
In more recent years, government responsibilities have extended to the economy and public service. An early principle of capitalism dictates that markets should be free from government control. But when economies spun out of control during the 1930s, and countries sank into great depressions, governments acted. The United States Congress created the Federal Reserve System in the early twentieth century to ward off inflation and monitor the value of the dollar. Franklin Roosevelt and his "Brain Trust" devised New Deal programs to shock the country into prosperity.
Perhaps government responsibility to provide social programs to its citizens is the most controversial of all. In the United States the tradition began with the New Deal programs, many of which provided people with relief through jobs, payments, and food. During the 1960s President Lyndon Johnson unveiled his "Great Society" programs aimed at eliminating poverty in the entire country. Many European countries today provide national medical insurance and extensive welfare benefits. Many Americans criticize these programs as expensive ventures that destroy the individual's sense of responsibility for his/her own well being. So the debate over the proper role of government in providing for its people's general welfare is still alive and well today.
Though the rules and responsibilities vary greatly through time and place, governments must create them. Governments provide the parameters for everyday behavior for citizens, protect them from outside interference, and often provide for their well-being and happiness.