New theory explains how magnetic switchbacks form in the sol