The oil and the oil filter need to be periodically replaced; the process is called an oil changes.
While there is a full industry surrounding regular oil changes and maintenance, an oil change is a fairly simple operation that most car owners can do themselves. It involves draining the oil from the engine into a drip pan, replacing the filter, and adding fresh oil.
In engines, there is some exposure of the oil to products of internal combustion, and microscopic coke particles from black soot accumulate in the oil during operation. Also, the rubbing of metal engine parts produces some microscopic metallic particles from the wearing of the surfaces. Such particles could circulate in the oil and grind against the part surfaces causing wear. The oil filter removes many of the particles and sludge, but eventually, the oil filter can become clogged, if used for extremely long periods.