In the distant past, sometime before the 23rd century, a malevolent alien entity was imprisoned on the planet. The entity was unable to leave the planet much less penetrate the Great Barrier, however, it could shake the planet and manipulate the surface. During its time, it became extremely bitter about its circumstances.
In 2287, the renegade Vulcan Sybok embarked on a quest to locate Sha Ka Ree, recruiting a large number of followers via telepathic manipulation. Using this technique to gain control of the USS Enterprise-A, Sybok informed Captain Kirk that he had located Sha Ka Ree via visions given to him by God himself. Although Kirk initially thought Sybok to be mad, his visions seemed to be proven correct when, after successfully penetrating the Barrier, the Enterprise crew encountered the planet on the other side.
However, upon traveling to the surface in a shuttlecraft, Sybok, Kirk, Captain Spock, and Doctor McCoy learned the truth about the being. The entity commanded them to allow it to join with the Enterprise, however Sybok sacrificed himself to occupy it while Kirk, Spock, and McCoy escaped. A Klingon Bird-of-Prey had followed the Enterprise and further assisted Kirk's escape in firing at the entity. (Star Trek V: The Final Frontier)