What Does The Dragon Egg Do In Terraria?

What is an ender dragon egg for?

.

Do pets do anything in Terraria?

What does the Gato egg do in Terraria?

How do you spawn a dragon in Terraria?