Aside from the obvious technological advantage of guns and horses, Hernán Cortés and the Spanish were fortunate to have several other twists of good fortune on their side as they attempted to conquer the Aztecs.
The Aztecs were the most dominant force in Mexico at the time and their dominance of other groups in the region created enemies. Cortés was able to ally himself with some of the enemies of the Aztecs, which helped the Spanish overcome a severe shortage in numbers. One such group, the Tlaxcalans was especially important in helping to capture the capital city.
When the Spaniards arrived in the capital city of Tenochtitlan, the Aztecs were stunned by their pale skin and were both terrified and intrigued by the horses the soldiers were riding. They actually believed that Cortés may be Quetzalcoatl, their chief god. It was prophesied that Quetzalcoatl would return to the land of the Aztecs. For this reason, Montezuma afforded the Spanish a surprising level of hospitality. Cortés used the friendliness of the Aztecs against them and captured the king and the city in short order.
Any hopes of rebellion against the Spanish were dashed when a smallpox epidemic ravaged the population. A Spanish soldier had contracted smallpox while in Cuba and died in Mexico. The Aztecs contracted the disease from the soldier and did not have an immunity to it. Thousands of Aztecs died from smallpox.