Simple water filters just block large particles and let tiny water molecules go on through. You can see this effect when you rinse vegetables in a strainer or colander. The vegetables are the large “particles” that are blocked.
A paper towel will block smaller particles. You can use paper as a coffee filter, to keep the coffee grounds in the paper while the water and other small molecules (the ones that give coffee its flavor and color) go on through.
If you want to get rid of those other small molecules, you might use an activated charcoal filter. Charcoal is very good at absorbing small molecules that color and flavor water. This action is not actually filtering, it is absorbing.
Once the charcoal has absorbed a lot of those small molecules, it gets full and can’t absorb any more. To re-activate it, you just heat it up. The small molecules boil off, and the charcoal is ready to absorb more again.
Paper filters and charcoal filters won’t block tiny things like bacteria. For that, the holes in the filter must be very tiny. But that means that the filter has to be very big, because even the tiny water molecules will be blocked most of the time. An alternative is to use a lot of pressure to force the water through the filter.
One type of filter that uses a lot of pressure to force water through tiny pores is a reverse osmosis filter. In normal osmosis, a filter sits between pure water and salt water. The water can go through the filter in either direction, but the salt ions are too big to go through the filter. This means that more molecules end up on the salt side of the filter. To reverse this, a large pressure is used on the salt side of the filter, to force the pure water through. So instead of water going from the pure side to the salty side, the direction is reversed, and you get pure water out.