I'm so confused

Someone help me understand. I'm in the battle tower in the BF, and just had a Metagross vs Magmar showdown. My metagross survived a flamethrower, and hits magmar with EQ. Magmar lived. Idk the exact IV metagross has in ATK, but its not bad and he's EV trained in it. Adamant natured. I looked at the base stats on serebii because i was questioning my sanity, but nope, i remembered correctly. Magmar has 57 base DEF and 65 base HP. Meta has 135 base ATK. Wtf happened?