New theory explains how the moon got there