The Mayas and the Aztecs were distinct civilizations, but they had quite a lot in common. The most obvious similarity would be in their understanding of kingship.
Both the Mayas and the Aztecs were ruled by powerful kings who believed themselves to be gods or descended from gods. As one can imagine, this gave them a tremendous amount of power and authority over their people, who were naturally reluctant to challenge the rule of someone of such elevated status.
This widespread belief in the Maya and Aztec civilizations was not simply an expression of one man's megalomania or delusions of grandeur. There were practical reasons behind it.
In Mayan culture, the belief in rulers as living gods stabilized the political system by making it easier for power to pass from one generation to the next without any interruption. If the royal succession was ordained by the gods, then it became much more difficult for anyone to put up a rival candidate for the throne, as in doing so, they would be going against divine will.
Much the same consideration applied to the royal succession in the Aztec Empire. The ruler of an Aztec city-state, the Tlatoani, would be permitted to have several wives at once, just like a god would have several wives. As with the Mayan belief in godlike rulers, this arrangement existed to facilitate the relatively smooth transition of power.
Although the Tlatoani was worshipped as a god, it is far from clear if he was regarded as a living deity. Even so, the Tlatoani enjoyed considerable power and wealth, owning all the land in his city-state. Though most Aztec emperors were elected under a semi-democratic system and could be removed from power under certain conditions, they still enjoyed divine status among their people.