A cartridge is, at its basic level, an electromechanical transducer. It turns the mechanical movement of the needle (stylus) in the record groove, into an electrical signal. There are two basic designs of a cartridge - Moving Magnet and Moving Coil (other variations of these do exist but let's focus on these two for now).
In a moving magnet cartridge, the stylus travels through the groove of a record, transferring its mechanical force up a cantilever to a magnet attached at the other end.
The cantilever and magnet move, interacting with a coil to generate an electromagnetic signal. The signal is then output through the four pins at the back of the cartridge.
In a moving coil cartridge, the mechanical process is the opposite of a moving magnet design. The mechanical force of the stylus transfers up the cantilever to a coil rather than a magnet.

Moving Magnet
In a moving magnet cartridge, the stylus travels through the groove of a record, transferring its mechanical force up a cantilever to a magnet attached at the other end.
The cantilever and magnet move, interacting with a coil to generate an electromagnetic signal. The signal is then output through the four pins at the back of the cartridge.

Moving Coil
In a moving coil cartridge, the mechanical process is the opposite of a moving magnet design. The mechanical force of the stylus transfers up the cantilever to a coil rather than a magnet.