During the incident of Tempest Shadow/SpongeBob plans to save the Princesses

Here is how SpongeBob SquarePants rescued the princesses in the past in The Overlord's Revenge.

As they all got here, they all went back in time to the past in Equestria.

SpongeBob SquarePants: Where are we?

Lloyd Garmadon:

Laval: