Cornerstone of Light
The Cornerstone of Light (光のいしずえ Hikari no Ishizue ) is a sacred relic of Disney Castle that appears in Kingdom Hearts II. A large sphere made of crystal or glass that sits atop an ornate pedestal and contains swirling light, the Cornerstone protects Disney Castle from Darkness. It can be found in the Hall of the Cornerstone, a hidden room under King Mickey's throne.
Although it is a powerful artifact and heavily protected, Maleficent takes advantage of a door that appears into Disney Castle-exile Pete's past after he is made miserable by her constant abuse. Using the door, Pete is sent back in time to when the Castle itself had yet to be built and the Cornerstone sat unprotected on a hill. There, he attempts to steal the Cornerstone, weakening the defenses of the present Disney Castle and allowing Darkness to penetrate the castle; the Heartless then invade and attempt to take the castle and its inhabitants prisoner. Maleficent's trademark thorns surround the Cornerstone and she appears in a vision to taunt Queen Minnie about her imminent victory.
Sora, Donald, and Goofy recieve a distress call and arrive just in time to help Queen Minnie raise a defense against the invaders. After a quick trip to Hollow Bastion to seek Merlin's help, they discover the time loophole that has allowed Pete and Maleficent to weaken the Cornerstone's protection. By taking a trip through a new door that appears in the Hall of the Cornerstone and leads to Timeless River, Sora and his party manage to thwart Pete and Maleficent's plans and restore the Cornerstone of the present to full power.
The Cornerstone also opens a gate to the worlds of Port Royal and Atlantica.
Plot Hole
Though the Cornerstone protects a world from Darkness, meaning no Heartless can appear there, it is present in Timeless River, where there are Heartless. This is never explained, although this fact was most like overlooked or ignored so enemies could be fought there. It might have been that the Cornerstone gathered power over time, or that Pete brought the Heartless with him.