All engines require fuel to make them run, and in precisely metered amounts. Anything that impedes the flow of fuel can cause poor starting or running issues. The fuel filter's purpose is to filter out dirt or debris that could enter the fuel system and cause these symptoms by changing the flow rate or pattern of the injectors.
Modern engines' injection systems have incredibly tight tolerances, so are easily clogged, and any contamination can prove to be very costly to rectify. The filter is a component that's important to replace regularly.
Older engines, particularly those with carburetors, are less fussy when it comes to fuel because the jet opening are much bigger than a fuel injection nozzle. But if you get a clogged, or blocked fuel filter you'll still experience problems, so neglect it at your peril. On a car with a carburetor, a clogged filter most often presents itself as a los of power or stumble after several minutes of freeway cruising.
There is also the issue with water contamination in diesel engines. Since diesel fuel floats on water, and doesn't mix, many diesel vehicles' fuel filters have a drain tap at the bottom of the housing that allows water to be drained off.
There are two main types of replaceable fuel filter, but both function in exactly the same way: fuel is passed through a filtration medium (often made from a special paper) which catches any contamination.
Some filters are simple plastic or metal containers, with two fuel line connections, around a filtration medium. These aren't intended to be serviced, instead you simply replace the entire unit. The other type is a cartridge-style with a replaceable filter housed within a metal container that can be opened. The lid of the container is removed, and the filter element is swapped for a fresh new one.
It's worth noting that some newer cars don't actually have a filter and simply rely on a strainer that's attached to the fuel pump, both located in the tank. These are only meant to be replaced if the pump goes bad. So if you can't find yours – don't panic!