How does TMS work?

TMS involves delivering magnetic pulses to specific parts of the brain.