http://www.jcpa.org/dje/articles2/jerusalem.htm
...It cannot be accidental that Cain, the first murderer, also founds the first city. In some respects, this can be seen simply as the linkage between urbanization and violence upon which many have commented.
But the Biblical story is more subtle than that.
Cain murders out of passion. He is not a reasoned killer, not cold-blooded nor one who murders for the love of it. He simply cannot control his passions at a particular moment or in a particular situation.
Significantly enough, cities are places where density and the pressures related to it lead people into uncontrollable acts of passion, acts which are often violent in character, far more so than rural areas. That is one dimension of the Biblical account.
Another is that people who commit violence need to protect themselves against retribution.
The earliest cities in the Bible are primarily places of protection. Historians of the ancient Near East generally agree that cities originally came into existence for defensive purposes, as places where the inhabitants of a region could come together to collectively defend themselves...
The Commandment to not murder makes no such distinction.