Shimming
Passive shimming is the placement of metal pieces within the bore of the magnet or on the outer surface of the scanner in order to "distort" the magnetic field within the bore into a more homogenous state.
Active shimming employs dedicated coils in the magnet through which current is passed (they may be resistive or superconducting depending on their placement) to generate an extra corrective magnetic field which improves the homogeneity.
Gradient coils are used these days to provide a first-order shim. The patient distorts the magnetic field when they are put into the scanner, and so an active shim correction can be made before scanning.
Further reading on this topic:
Books: MRI From Picture to Proton p169-170, Q&A in MRI p60
Online: Chickscope