Exchange of energy between two systems at a specific frequency is called resonance. Magnetic resonance corresponds to the energetic interaction between spins and electromagnetic radiofrequency (RF).
Only protons that spin with the same frequency as the electromagnetic RF pulse will respond to that RF pulse. There is a modification of spin equilibrium and absorption of electromagnetic energy by atomic nuclei, which is called excitation. When the system returns from this state of imbalance to equilibrium (relaxation), there is an emission of electromagnetic energy.