The enemy pawn advanced to my first row and then a second black queen appeared – Why?

That is a Promotion; a pawn will be promoted to queen (or other piece) if it reaches the last rank. Please consult the official chess rules for details.