The primary purposes of a government are to create laws, enforce laws, apply laws to the citizens, and protect the citizens. In some forms of government, all of these functions are subsumed under a single branch of government. Other forms of government have multiple branches of government that divide up these functions. Many current governments divide these functions into three branches: legislative, executive, and judicial.
The legislative branch's role is to create the laws. In some systems the legislature can self-enact laws whereas in others the executive branch must approve and enact the laws. The legislative branch is often charged with providing for the sustainability of the political entity through creating laws to raise revenue and budgeting that revenue.
The executive branch is responsible for enforcing the laws and for protecting the citizens of the political entity from external and internal threats. Typically, the executive branch does not create laws, although it may be able to create regulations for how laws will be enforced as well as set priorities for the enforcement of the laws. The executive branch also collects and administers the revenue of the political entity.
The judicial branch is tasked with applying the law to the citizens of the political entity. The judicial branch may also determines the penalty for violations of the law if those penalties are not specifically manifest in the laws themselves. In some systems the judicial branch may interpret the meaning and application of the laws whereas in others the judicial branch may be limited to applying the law to individual situations. Finally, the judicial branch may have the power to review, and even overturn, the laws passed by the legislative branch and the regulations and actions of the executive branch.