How did Hernando Cortes conquer the Aztec Empire?

he dident defeat them the 1st time but the second time he brought back a bigger army and defeated them. he captured their king and kept him hostage he later murdered him anyway