Where did our planet come from? Why is it here (with us, conscious intelligent beings, on it)? Where and how is it going to end? These interesting questions (I've massaged them a bit) are discussed in John Gribbin's Alone in the Universe: Why Our Planet Is Unique (John Wiley and Sons, 2011). Other authors have discussed the same general topic, but Gribben does the best job I've seen of reviewing the many ways in which Earth seems so terribly well positioned to favor the origin and development of life.
There are familiar Mormon answers to these questions, of course. These answers are concisely presented in chapter one of the Book of Moses, which is a preface to Joseph Smith's restatement of the first few chapters of Genesis, published as the Book of Moses in the LDS Pearl of Great Price. The speaker in the following quoted passages is God the Father. As to creation, in verse 33:
Worlds without number have I created; and I also created them for mine own purpose.Why Earth is here, verse 39:
For behold, this is my work and my glory — to bring to pass the immortality and eternal life of man.And the reassuringly optimistic pronouncement as to the fate of the planet and the cosmos, verse 38:
And as one earth shall pass away, and the heavens thereof even so shall another come; and there is no end to my works, neither to my words.
Gribben adopts the standard cosmic and biological evolution narrative for the first two questions. As to the third question ... well, the news is not good. He summarizes recent findings concerning a nearby star named Gliese 710, which is 63 light years away and appears to be headed more or less directly for our Solar System.
It is heading our way at a speed of roughly 50,000 km per hour, and is destined to pass through the Oort Cloud of comets at the fringes of the Solar System within a million and a half years; it might even get as close to the Sun as the Kuiper Belt. The disruption of the Oort Cloud resulting from this close encounter will send debris into the inner Solar System on a scale not seen since the Late Heavy Bombardment. If Gliese 710 has its own comet cloud, as seems likely, the bombardment will be even more intense. Without a doubt, this will result in the extermination of all life on Earth, and send our planet back to the kind of state it was in just after the formation of the Moon.
For me, it's the Yellowstone Supervolcano, due to erupt any century now, that gets my attention. But the upcoming tale of Gliese 710 reflects the inexorable workings of celestial mechanics (ignoring chaos theory and the three-body problem, which don't seem relevant to this scenario). You just never know with volcanoes, but comets, planets, and stars zooming through space follow very predictable courses. The sun will rise tomorrow, then 500 million more times, then comes a parade of planet-killers from the Oort Cloud. As one earth shall pass away, even so shall another come.