The correct answer is - taxes.
After the civilizations started to establish themselves and prospered, they needed to secure their citizens, and that was only possible if they had a strong military that will keep any intruders out of their territory.
The military is not cheap, and it needs a lot of funds, as it constantly needs food, clothing, armor, weapons, training, and all of that had to be sponsored by the governments/rulers. In order to be able to have strong and happy military forces, the governments started to tax the people, and initially that was only to sustain the military, but over time developed much more and is used for lots of other things nowadays.