Minecraft wiki entry for Ender_Dragon, associated text: Guarding
The dragon begins in this state, circling the ring of obsidian pillars on either the outside if there are still End crystals or the inside if the crystals are destroyed.
With each crystal's destruction, she takes damage and there is an increased chance of the dragon switching states.