The Aztec social classes grew incredibly sophisticated and complex once the Mexica people settled and began to build their empire. It's been said that the class structure was so elaborate that it impressed the Spanish almost as much as the architecture of the empire. And the way it all started is a fascinating story.
The Mexica people, who later became the nucleus of the Aztec
empire, were, for a time, a nomadic tribe looking for a home. As they
moved south, they came into contact with advanced peoples. Many peoples of the day looked back to the impressive culture of the
Toltecs, and the Aztecs came to admire the Toltec heritage. In fact,
eventually the word for artistic creations would be toltecat, for the Toltecs, and the Aztecs themselves would claim to be descended from the great Toltec nobles.
The Mexicas were anxious to claim a Toltec heritage, so they chose a nobleman of Toltec origin as their first king, a man named Acamapichtli. He fathered a great many children by 20 wives, and his descendants became the heart of a new social class in the empire - the nobles or pipiltin (singular pilli). From then on, a king would always be chosen from among the pipiltin.
The nobles had many other privileges. They generally received a fuller education, they were allowed to wear fancier clothes and decorate their houses. They were allowed to hold important government offices. But not all had positions of authority - some were craftsmen, or even palace servants. Those who served with distinction could move up the ranks.
Basically, the ruling positions were not hereditary, but preference was given to those in the "royal families".
Technically, there were only two Aztec social classes - the nobles and the commoners. The common people were the macehualtin (singular macehualli). Besides these two main classes, there were a number of different positions that worked like sub-classes. Many of the macehualtin worked the land. They might work a portion of land for life, though technically it was communally owned, and they would work under authority. Some were only hired hands or tenants, and some were even slaves.
Slavery (a slave was a tlacotli) was not hereditary, and
there were ways for a slave to gain freedom. If someone was in
economic difficulty, they could sell themselves as slaves. Slaves were
strictly protected by the law.
As time went by and farming became more efficient, less people were needed to farm, and other parts of society became stronger. Craftsmen and merchants, for example, had a higher social status in society.
Merchants were a privilege class. With the ability to travel and deal in valuable objects, they had a certain amount of freedom many Aztecs didn't have.
Also, in a world where war was so common the soldier had a good chance of rising in the ranks. A soldier who served with distinction could hold an office normally held for a pilli. In this way, almost all levels of government could be shared with the commoner as well as the noble. A warrior who captured many prisoners could be knighted. This would be the first major step up the ranks.
For more on the Aztec social classes: