The spell to conjure the Dome was spoken by mayor Patterson with the Spellbook of Mors Gotha, cutting off Castle Britannia from the rest of the world. The Guardian did the rest of the magic to create it. As always with the Guardian's magic, a smaller copy of the object appeared in it, at the bottom of the construct. That Blackrock Jewel also was the gateway to other worlds. The Guardian strengthened the Dome with power lines from these worlds, while smaller blackrock gems had appeared as by-product of the creations of the dome in these worlds.
The Avatar weakened the Dome by fusing the smaller blackrock gems with the big jewel (after treatment by Nystul) and cutting the power lines with Altara's Scepter. Just when Mors Gotha and her men invaded the castle from Killorn Keep, the combined power of the spellbook and the Horn of Praecor Loth with a Air Djinn, shattered the Dome and closed the gate to the other worlds.