One way they did it was by enslaving people. Those who committed crimes or were enemies from wars were enslaved and had to work and build things like buildings or holy temples or palaces for the king or similar things. This would be their punishment for stepping out of line and nobody wanted to step out of line.