There are two basic oil-filtering systems - full-flow, and by-pass. The full-flow type filters all of the oil before delivering it to the engine. The by-pass type only filters some of the oil.
The full-flow type is the more common. Its filter uses pleated filtering paper in a metal housing, to collect harmful particles.
Normally all oil goes through the filter before it gets to the engine, but if the filter clogs up, it can starve an engine of oil.
As a safety measure, full-flow filters have a bypass valve. If the filter clogs, this valve opens and directs unfiltered oil to the engine. Dirty oil is better than none at all.
Most oil-filters on diesel engines are larger than those on similar gasoline engines, and some diesel engines have two oil filters.
Diesel engines produce more carbon particles than gasoline engines, so the oil filter can have a full-flow element to trap larger impurities, and a bypass element to collect sludge and carbon soot.
In a by-pass system, the bypass element filters only some of the oil from the pump by tapping an oil line into an oil passage. It collects finer particles than a full-flow filter. After this oil is filtered, it goes back to the sump.