Montezuma (whose name means "he frowns like a lord") came from a royal family. His father Huitzilihuitl was the second Aztec "tlatoani" or emperor, and his mother, Miahuaxihuitl, was the daughter of the ruler of the city of Cuauhnahuac. Following his father's death, Montezuma's uncle Itzcoatl was elected. Montezuma's older brother Tlacaelel was one of Itzcoatl's closest advisors, while Montezuma served as a general in the Aztec army.
Following Itzcoatl's death in 1440, Montezuma was elected emperor. Tlacaelel did not seem at all unhappy about being bypassed (perhaps he thought he'd live longer if he didn't get the crown), and by all accounts he served his brother faithfully. Montezuma's coronation was a huge ceremony involving the sacrifice of many prisoners.