To me the most fascinating aspect is not filtering out large chunks, but that it prevents the highly acidic gastric fluid (the pH ranges from 1 to 3) in the stomach from reaching and damaging the small intestine. The stomach is equipped to deal with the extremely acidic fluid for digestion, but the small intestine is not.
Neutralization of acid is actually done in the duodenum. We have organs called Brunner's glands lining the top half of the duodenum that secret a special mix of alkaline bicarbonates and growth factors in a thick mucin carrier. This neutralizes the gastric acids and lines the small intestines with protective mucus.
You're right though, the engineering that goes into our bodily machines is mind boggling.
Man.. I wish there were more research and therapies in this regard... I've been on PPI for over 20 years because of consistent heartburn... (Sliding hernia). The operation to "fix" it they wrapped your stomach around your oesophagus but that seems like not a great solution..
Anecdotes are not data but I was able to stop a long history of upper GI issues (and terrible heartburn and acid reflux) by drastically changing my diet. Turns out I'm not compatible with the standard western food staples.
The Western diet is horrible in all honesty. Eliminate carbs and red meats (the core of Western diets) and it creates a world of a difference for many folks, from people trying to achieve ketosis to people suffering from Crohns. Incidentally my Crohns was latent for quite a few years and only flared up when I moved West.
Mine is low carb, but also no wheat. Even when I do small (or even sometimes medium) amounts of rice, enough to absolutely not be in ketosis, I am still better than I was when eating bread or bread-containing/adjacent things (breading, pasta, sandwiches, et c). We know I'm not celiac. Perhaps it's some weird allergy; in addition to acid reflux eating such things also used to cause me ENT issues like coughing/congestion which have gone away entirely since I stopped. None of the traditional "allergic reaction" symptoms, though.
Who knows?
All I know is that it's different for everyone and for lots and lots of people, eating totally normal things is what causes or contributes to lots of bad symptoms misattributed to some disease or disorder. More often than not it's not you, it's the utter garbage food that our society has standardized upon. Just because it's common to eat a sandwich, or pasta, or a bowl of cereal or granola, or a bagel doesn't mean that human evolution has caught up with it yet.
Have you tried cutting out coffee and dark tea? Both myself and my mom have found that it decreases ongoing throat irritation and coughs that run in our family.
Fortunately for me coffee and tea are some of the completely harmless/fine foods, at least to my body. I can even use heavy cream and sucralose with no issues.
I live on espresso/tea, heavy cream, protein/nutrition shakes, zero-cal flavor syrups, and grilled beef. It's sort of crazy how much healthier I am eating this than if I ate, say, even healthy sandwiches. My body just seems to dig being primarily a carnivore. If I personally liked vegetables and leafy greens more I would probably do vegan keto, as I don't like how unsustainable western meat production is, but I simply can't get into the idea of leafs as food.