The moon was once part of the earth. Due to the rapid rotation of the primitive earth, the moon broke away from it. The moon formed from the outer layers.
THEORIES ON THE ORIGIN OF THE MOON