Larmor precession. A proton spin in a field B0 precesses at f = (gamma / 2 pi) B0 with gamma / 2 pi = 42.577 MHz per tesla, so 63.87 MHz at 1.5 T. A scanner works with a radio signal at exactly this frequency.
Polarisation. At body temperature the spins are only slightly aligned: P = tanh(hbar gamma B0 / 2 k T) ~ 4.9 parts per million at 1.5 T. Tiny, but with 10^22 protons per gram it is measurable. Higher B0 means more signal.
Bloch equations in the frame rotating at the central Larmor frequency; spin k is off resonance by delta_f_k = f_k - f_0:
An RF pulse tips the magnetisation by a flip angle alpha (modelled as an instant rotation). Afterwards Mz regrows toward M0 as 1 - (1 - cos alpha) e^(-t/T1), and the transverse magnetisation of each spin decays as sin(alpha) e^(-t/T2).
Dephasing and echo. Field inhomogeneity (here a spread of W = ppm x 42.577 x B0 Hz across the sample) makes spins precess at different rates, so their sum decays much faster than T2. A 180 degree pulse at TE/2 reverses the phases; the spins refocus at TE and the signal returns to e^(-TE/T2) (the spin echo, Hahn 1950). The echo cannot undo true T2 decay, which is what scanners measure.
Link to quantum computing. Each spin is a two-level quantum system; the pulse is a single-qubit rotation and T1, T2 are the same relaxation and decoherence times quoted for spin qubits. Echo sequences are the basic tool for fighting dephasing in both.
Simplifications: 240 isochromats on a uniform spread of frequencies (40 drawn), ideal instant pulses, no diffusion, no spatial encoding or gradients, no T2* from anything but the uniform spread, one tissue at a time.