There are two kinds. Chip detectors and chip collectors.
Chip Collectors are as Munster said - removable magnets which attract the ferrous material as the return oil flows across it. Inspected periodically for unwanted material.
Chip Detectors are also magnets but they have a gap in the magnetic tip which has +ve supply on one side and (usually) a ground signal on the other side. When a piece of metal bridges the gap it closes the detection circuit and flags up the appropriate message which can be an EICAS message, maintenance message, CWP caption or just a dolls eye on a maintenance panel, depending on aircraft type.