It's not just Apple, tablets and laptops have been on a collision course for years. The use cases have started to blur for all manufacturers and software remains the dividing wall. For the iPad to contend with a laptop it has to run macOS and have it's software available. For the macbook to replace a tablet it should have a touch friendly interface and run all apps from the app store.
The truth is that this is the big headscratcher for all product managers at all big tech manufacturers. It is also the factor that keeps all existing ecosystems fractured. Including Apple's, though it is perhaps the most well integrated one. The second dividing wall to tore is screen size and input periferals, of course. None of these are easy or trivial problems to solve.
Yes, there's no reason for a M4 not to run macOS and work as full desktop. Apple is just keeping iOS as basic and locked on as possible because 1) they want to protect their laptop business and 2) they're better off if people move their workflows into iOS Apps and Safari because unlike macOS they control what software is available and runs on iOS. The AltStore situation is bullshit as developers are still bound by the same rules and forced to submit apps for review. Until iOS doesn't allow anyone to run unsigned and unrestricted code the MacBook lineup is safe.
tablet running MacOS is what a lot of people want and the price is comparable to a MacBook Air.
Exactly because of that. If they allow macOS on the iPad then people will only need to buy one device. Right now people are forced into buying two devices (thus more profits) because iOS is heavily restricted and doesn't cover on all their needs.
They also want to people to be running iOS and not macOS because everything is code signed and allows them to gatekeep applications. It is way more likely they'll eventually add a few more desktop UI to iOS and kill the MacBook line than allowing macOS as it is right now into the iPad.