Here's the best guess as to what happened:
About 4.5 billion years ago, not long after the Sun ignited and the planets were settling down into recognizable sizes and orbits, there was a Mercury, a Venus, a Mars and Jupiter and so on -- but no Earth.
Occupying our orbit was a planet, without moons, and somewhat smaller than Earth. I've never heard it given a name; let's call it "Tellus"[1] for now. It is doomed from the start.
Another planet, from an unknown spot in the solar system, was on a collision course with Tellus. (Oddly, this one does have a name: it is called "Theia.") Theia was slightly smaller than Mars. (I'm going to speculate here on where it came from; this speculation is fairly broadly accepted at this point but is certainly no "final answer.")
This was so recently after the formation of the solar system that the planets had not cooled much; their surfaces would have just begun to crust over, and life probably hadn't gotten started at all. But if it HAD gotten started, it suddenly ended, when Theia and Tellus collided.
Imagine standing on the surface of that "proto-Earth" -- or better yet, watching the proceedings from a little distance away: Theia had been just a moving point in the background of stars, and there were lots of those in that time; a lot of debris had yet to be swept up by the planets. Things were stable for millions of years (a small time still) until the gravity from the accumulating Venus pushed Theia just right, and just enough to nudge it out of its comfortable spot. Now it swung like a slow pendulum, moving further from safety each time.
Over a period of a few years, the little dot becomes a recognizable disk, a bit like Venus. It grows larger each day, but then recedes again. A year later, it's closer yet -- but it is not quite ready for the final dance, and shies away yet again.
Finally it's an obviously larger disk -- and this time it will not be dissuaded by vagaries of gravity or orbital niceties.
Briefly, it appears in the sky about the size of the current-day Moon, but at this point things are about to change. In the last hours of the approach, the gravity forces of the two bodies start pulling each other apart. Gigantic fissures, thousands of miles long, snake across the surface of both bodies, and lava tides lift surfaces thousands of feet in the air. Mountain ranges grow in minutes, glowing red-hot and near molten, rising visibly into the sky as barely-cooled surface crust plates are jammed violently together, exposing the magma beneath.
The new mountains will last only minutes.
Theia and Tellus collide, perhaps looking a bit like this illustration:
Note, in the picture, that both planets have changed shape slightly in the region of the impact. In the last few minutes, an observer would have seen them rush together, as Theia's own size (about 10% of Tellus) was enough to pull Tellus perceptibly toward it.
The impact would have been spectacular. The entire upper layers of both planets would have been splashed into space, and the impact would have completely melted both bodies once again. It would not take long for the remaining molten glob to become a globe once again, but it would be hard to see through the cloud of solidifying chunks that had been splashed into various orbits around it. From a distance, the spot in the sky would have gone brilliant white, then "fuzzy" as the debris field cooled and coalesced around it.
Some of the debris fell back. Other pieces collided with each other, pulverizing small ones and re-melting larger ones. Bigger pieces attracted their neighbors, and as they grew started sweeping out the regions around them as they circled to the glowing planet below.
Eventually enough of the big pieces came together to form a new little planet circling the mortally wounded parent, which was now part Tellus and part Theia. Anything above a few hundred kilometers generally has the gravity to pull itself into a spherical shape, and that happened here. It accumulated more material, becoming ultimately a couple thousand miles across -- but this new body was the mostly lighter, upper parts of Tellus and Theia -- and thus it was a comparative lightweight among rocky planetoids.
The new pair are the size and shape of the Earth and Moon -- but your would not recognize these hellishly glowing bodies yet. And the Moon is much closer to the Earth; it formed about a third of the current distance. Whatever spin it had was lost, over the next billions of years, and various interactions between the gravity of the two "pumped" the Moon into a higher orbit.
This pumping is still going on; the Moon gets a few centimeters further from the Earth each year. And the only remaining aspect of its original rotation (with respect to the Earth) is the fact that the Moon rocks gently back and forth, about 7 degrees, as the traces of spin gradually die out with time. (This allows us to see, incidentally, a little bit "around the corner" into the far side, but not much.)
Where did Theia come from? We don't know for sure. But as one body orbits another larger one, there are a few well known "eddies" of gravity that occur at a couple of points around the orbit. These are called Lagrange points, and two fairly stable ones (Lagrange Point 4 and 5, or L4 and L5) are about sixty degrees in front of and behind the smaller body.
The Earth-Moon system now has Lagrange points; a proposal to build a space station at one of them gave rise to the L5 Society. Decades ago, I was part of it.
But the Earth-Sun system has Lagrange points as well, something like this:
We think there's a good chance that Theia formed at one of the L4 or L5 points ahead of or behind us in orbit. Not long ago, we launched a pair of satellites to go find out something about that.
Because of the gravitational eddy effect, it may well be that parts of what were Theia are still there, preserved for 4.5 billion years.
The pair of spacecraft, STEREO A and STEREO B, are going to look for them. The article calls these points "gravitational parking lots"; it's fair enough.
The animation of the mission (and orbits) is pretty nice, through it's 19MB. ===|==============/ Level Head
[1] I have no doubt that someone's come up with an "official" name for the pre-Earth; if you find it, let me know.