MRI works by aligning the protons in the body's hydrogen atoms using a strong magnetic field. Radiofrequency pulses are then applied, causing these protons to produce signals that are detected by the MRI machine. These signals are processed by a computer to create detailed images of the internal structures. The ability to produce images in multiple planes without ionizing radiation makes MRI a valuable tool in gynecology.