I'd say they came about because of our early tribal mentality. They evolved because those at the top became wiser in terms of human farming. Slaves are inefficient workers. Then they gave us a little more freedom under feudalism where you owned a plot of land in exchange for your labor. Still though, they found that if you give an individual more perceived freedom in the right to choose trade, education, etc.. they become more productive, and thus generate more monies from which they can tax. That's where we are now..
Except now, with the advent of technology & the internet, more of us lowly wage slaves are connecting more than ever which is a threat to the establishment. The national branding campaigns put forth through media and education, with our flags, anthems, phrases, as a way to make governments seem a necessity, won't hold out too long. At least, I hope.
[ame="http://www.youtube.com/watch?v=Xbp6umQT58A"]The Story of Your Enslavement - YouTube[/ame]