The first cities had the market, the citadel and the temple. Babylon had huge walls miles in circumference. Farming never could get far without the protection of the armies which cities generated. Raiders would just come and take everything without impunity until the cities developed.
Famines which produced widescale death were not common in Europe. Nor were they more common than war.
That is simply wrong. Prior to the 17th century famines struck at least one major European city every decade or so. All it took was two consecutive years of a bad crop cycle and the people starved. That they also typically accompanied any major war in some place or another makes it physically impossible that they could have exceeded such wars in number.