A foam filter functions on the principle of the "tortured path". Yeah kinda made up that term. But it applies pretty well.
The filter's base filtering rating is related to the size of the cell bubbles that comprise the foam membrane. Generally nothing can get past unless it fits through tiny holes. Most bugs, plant, and dirt flakes will pile up on the outside. This, of course, is better than having the engine ingest them.
On to the next level of particulate matter; finer abrasive dust/sand, etc.
You'll note that seeing through the filter membrane is difficult at best. This is because the open cell foam structure does not reveal line of sight pathways. And this is the reliant principle by which all foam filters operate. Air cannot take a straight through pathway through the filter membrane. It has to twist and turn to get to the other side. The mass of the dirt particles is heavier than air molecules, and so have a difficult time changing direction of travel. The particles then collide with the foam cell structure and hopefully stick. This is where the oil comes in. Particles are more readily trapped by an oil whetted adhesive surface.
Of note, is that foam filters are what is termed "statistical" filters rather than absolute filters. The foam pathways are bigger than almost all dust particles. But, they statistically trap most particles due to oil's adhesive properties, and the "tortured path" they are forced to take through the membrane. Since the oil is a functional part of the foam filter system, a thin but pervasive coat throughout the membrane is desired. But, note, there is no guarantee that it will trap ALL particles which are smaller than the size of the cells in the structure.
Also, they are not install and forget. The dirt and oil must be cleaned out periodically in relation to whatever dusty environments you operate within. Dirty foam can dislodge the trapped particles with shock and/or oil's adhesive fatigue. Then it dumps the oiled globs of dirt into the intake for ingestion. Not a good thing. So, it is best to stay on top of the cleaning cycles.
In the environment I'm used to (CA bay area), we have low particulate laden air. So, I've been using the UNI foam filter inside the stock air box now for decades. I've noted that summer use requires more frequent filter cleaning cycles than in winter months.
With my move to Arizona, I will have to revisit my foam cleaning schedule and perhaps return to the more expensive Paper filters, which guarantee finer particle collection at the expense of more frequent replacement schedules, due to not being able to effectively clean them after some use.
Lastly, the foam DOES deteriorate with age, at which point bits of foam, clean or dirty, pass through the engine cylinder on it's way to the exhaust with varying degrees of abrasiveness. This occurs with UNI foam whether its a POD type or the air box element. This is best found during a clean/re-oil process. Rather than years of in situ use. In my experience, 10-15 years is the service life, with proper cleaning solvents and correct oil use.
Cheers,