What is the purpose of government?

The purpose of a government is to secure the order. By doing so, it guarantees that people will follow the rules in order to live in an equal environment. With no control, people would live a sort of state of nature, which according to Hobbes:
“The RIGHT OF NATURE, which Writers commonly call Jus Naturale, is the Liberty each man hath, to use his own power, as he will himselfe, for the preservation of his own Nature; that is to say, of his own Life; and consequently, of doing any thing, which in his own Judgement, and Reason, hee shall conceive to be the aptest means thereunto.”
As the result of a common agreement and sort of social contract among them, people would follow the rules and live in peace. Otherwise, they would end up fighting each other and competing for resources instead of growing together.
References
Hobbes, T. (1651). Leviathan. The Project Gutenberg. https://www.gutenberg.org/files/3207/3207-h/3207-h.htm