Air filters use a variety of media, but the basic idea is to allow as much air as possible to enter the engine while trapping anything that could damage it. This seemingly simple task is actually quite a bit more complicated than it sounds. The engine's vacuum does its best to pull everything through the air filter's tiny holes.
Almost all air filters are like nets. Ideally, the air filter's holes would only be big enough to pass the individual oxygen atoms through, excluding anything not required for combustion. This would also include nitrogen atoms in a perfect world (which comprise about 78 percent of our planet's atmosphere by volume). Actually, this isn't physically impossible; oxygen atoms are physically smaller than nitrogen's and far smaller than any dust or particulate.
Although it would be theoretically possible to build an oxygen-atomic filter, the fact is that the "threads" (molecules) used to make the "net" would be much larger than the holes through which the oxygen passes. This would pose a serious impediment to airflow, the basic problem for any air filter. If, for example, you used a filter with 4 micron-wide holes (a dust particle measures about 5 microns), you'd have to use threads that were about 1/30th the width of a human hair to pass as much air as you're blocking.
Let's say you were to build a filter to catch dust particles (5 microns) using the thinnest of human hairs (about 50 microns) as a filter material. Now, let's assume that the engine's main intake is a 4-by-4 inch square. You'd need a filter surface that was ten times larger than the intake valve to pass sufficient air, which comes to about 13-by-13 inches, because the hair is 10 times thicker than the holes. That's not a huge amount, but clogging makes it far from adequate. Once the filter starts catching those dust particles, the number of holes through which air can pass reduces exponentially, requiring a larger and larger filter as time goes by. It is for this reason that manufacturers pleat (fold) the filter media back onto itself hundreds of times. This ensures that there are enough holes in the filter to pass air even after several years of dust trapping.
Filters can be made of several different materials. The most common is dry paper or cotton gauze, but other options include foam and oil-impregnated cotton. Foam filters typically flow very well, but aren't very durable. The oil in oil-impregnated cotton filters helps dust particles to stick to the fibers, meaning that the holes can be larger to flow more air. Many aftermarket performance filters are of this type.
All road-going automobiles have an air filter assembly of some sort. These simple, but crucial devices are intended to keep dust and road debris out of the engine. Even tiny dust particles can damage an engine's delicate internals when it is subjected to the extreme heat of combustion; those engines that use internal sensors for fuel injection are even more susceptible.