Actually, it was a lot closer then most people think. There was one battle where Cortez and his gang got there asses kicked by the Aztec (also called "Mexica") and sent running. If the Aztecs had followed up they could have wiped Cortez and his expedition out, but they didn't and that allowed the Spanish to re-group and rest.
The Spanish were most diffently a shock to the local inhabitants of Mexico. Spanish weapons gave to them a huge advantage, especially horses. Another weapon that absolutely terrified the locals were the Spanish use of "war dogs."
As for the Aztec belief that the Spanish were "gods" has been questioned. When Cortez first landed in Mexico, the locals after initial contact didn't hestitate to attack the Spanish. Also the some inhabitants of Mexico had been exposed to Spaniards prior to the arrival of Cortez. Years previously some Spanish sailors were shipwrecked off of Mexico and the survivors were taken in by the local inhabitants. And in one case of one individual who went "native," married a local women and raised a couple children with her (first mixed-blood children in Western Hemisphere). When offered the chance to return to Spain he refused.
If anyone is interested in the conquest of Mexico by the Spanish I highly recommend Daniele Bolellis History On Fire
podcasts. Back in 2017 (see Archives), he produced four episodes (Conquest of Mexico) that go into very good detail of the conquest and come out at about total of nine and half hours. Just one caveat, not for children! What the Spanish and the Aztecs did to each other were pretty brutal and the podcasts are not for the faint hearted.