Krakoa was a normal island nearby a nuclear testing site. Somehow, the repeated bombardments of radiation caused the island to mutate into a living ecosystem. Krakoa needed to nourish itself, so it attracted the X-Men to feed on. Most of the X-Men were captured, except for Cyclops, who the island supposedly released to attract more mutants.
Recruiting a new band of X-Men, Cyclops returned and defeated the island. Polaris caused a magnetic pulse from the Earth that was so powerful it shot Krakoa into space.
It was recently discovered that Krakoa was not sentient at all, but a collection of nerve impulses. Professor Xavier had originally sent in a group of younger mutants to save the X-Men. The younger mutants only managed to save Cyclops, and were shortly thereafter killed by the island. The simulation of the island being sentient had been part of Professor Xavier's ploy to make the X-Men forget the team of younger mutants.