I'll use the location that I worked at as an example. In Wilmington, NC, once your carrier returns to the station, they drop your letter into a collection bin. This collection bin is driven to Fayetteville, NC, where it is then processed via OCR. After being OCR'd it has a machine-readable bar-code, and will be sorted for delivery to a local station. The machinery involved in the OCR and sorting process is larger than any of the local stations I worked at. Additionally, almost all of the mail pieces that I delivered were intercity, not intracity. Your use case is the exception, not the rule.
There are many exceptions and corner cases to what I described, but that's what the process looks like for most mail pieces. Locating the scanning and sorting machinery at a hub rather than each individual spoke makes sense. UPS, where I currently work, has some minor differences, but the hub and spoke model is largely the same.
Now, utility bills come from some distant office, as do letters from banks, and we don't send invitations very often.
X years ago, bills were sent by closer companies, the bank was local and it was polite to invite someone to dinner by letter.
With that, it would have made sense to separate local and other mail as soon at the postman brought it to the post office.
I seem to remember a "local only" box in the town where I grew up but that hasn't been a thing for decades now.
Post offices around us have two mail slots when you walk in to drop mail in the box: local only, and everywhere else. Presumably they have (once had?) separate localized processing for those in the “local” bin. Because of post office closures and reduced hours, I think everything is just passed off to the regional facility for the last few years.
Another interesting discovery: I live about 3mi from my parents. They’re over the line in another county. My post office services them, but when I still lived in their house, all our local government business (schools, taxes and whatnot) was in the county seat about 15mi further away from the serving post office, closer to the next regional facility further south. If we ever dropped mail, say from mom to her mother, in that town, it took at least an extra day because it had to hit two regionals before getting to grandmother’s local.