The theory is that when Earth was a relatively young planet, it was struck by a giant object and this collision broke a piece of the Earth away to create the moon. This piece then began to orbit the Earth as a result of its gravitational pull.