Apart from any divine intervention there are three major theories as to how the moon was created. Considering how long ago the formation of the moon occurred there is no way to know for certain or to test which theory is true so the fact remains that we never know for certain. One theory is that the moon coalesced from a rotating cloud of space dust as the Earth forming. Another theory is that the moon was a rogue planetoid that was passing near the Earth and ended up being captured in the planets gravity well and becoming trapped in orbit around the Earth. The third theory is that still forming Earth, at some time in the distant past, was hit by a massive asteroid and caused a large chunk of the early planet to be blasted into orbit eventually forming into the moon.
While not all scientists agree on a single theory as to how the moon was created there is some strong evidence that the orbit of the moon is causing the moon to slowly move toward the Earth. If the moon is moving closer to the Earth that means that in the distant past it’s orbit was much further away. The theory suggesting that the moon was carved out from the Earth probably isn’t accurate if the moon used to have an orbit that was much further away from the Earth than it is now.
There is also some compelling evidence that the presence of the moon in Earth orbit helps to stabilize the axial tilt of the Earth which is necessary for preventing excessive climatic changes through the different seasons. Since a stable climate is necessary for the formation of life it is doubtful that moon capture theory is correct. The formation of life on Earth occurred shortly after the formation of the Earth itself and it is doubtful that the early Earth (before life) would have had enough of a gravitational pull to capture a passing planetoid.
Considering that the moon capture theory and the chunk of Earth theory probably are not very likely then the coalescing moon theory is probably the most likely to be accurate. If the Earth and moon formed at the same time then the Earth’s axial tilt would have been stable from the start allowing for the formation of life and the problem of blasting a chunk of the Earth into an extremely high lunar orbit is avoided.
Without some sort of window into the very distant past there really is no way to know for certain which theory is correct and undoubtedly there will be new theories developed to explain the creation of the moon. Until there is a definitive explanation to describe the formation of the moon theories are all that will exist.