Omicron aside, peak infection rates were around 30 cases daily per 100k. The odds of the guy next to you having COVID were always very low. The odds of someone in the same building, airport, plane, bus, classroom, workplace, etc. having COVID were often quite high.
Airplane filtration systems mean you /only/ have to worry about the guy next to you, and not about everyone else on the airplane. That's pretty low risk.
The other curiosity about COVID are superspreaders. Most people don't spread COVID very much. A few people spread COVID /a lot/. The question isn't just whether you're sitting next to someone with COVID, but whether you're sitting next to a superspreader. If the person next to you has COVID, but isn't shedding a lot of virus, you're probably okay too.
That said, the guy next to you likely isn't shedding microscopic particles, but pretty large droplets. Your mask stops large droplets pretty well. The airplane filtration system just needs to get them before the become microscopic particles.
Rather, some of the air going into the big fans of the engines is diverted into some air conditioning machinery that gets it to a comfortable temperature and humidity, and then pumped into the passenger compartment. In order to maintain the correct pressure, there are basically "leakage" valves that let air flow out of the plane. An airplane maintains pressure by balancing how much air is allowed out of that valve vs how much air is coming in through the AC machinery. The result is the vast majority of air inside of a plane at any time is air that was previously outside the airplane.
To be pedantic, modern bleedless engines don't do this but just directly get fresh air :)