They have greatly improved their support. New Samsung phones come with a 7 year update promise, while up until the Note 9 you got 2. Not to mention that a phone doesn't become useless the second it looses update support.
Also about the yearly hardware "updates". Thats exactly what they are. Slight updates. If anyone is still stupid enough to upgrade every year its on them really.
I'm a fan of manufacturers releasing yearly upgrades as a consumer. It means the old model always drops in price quickly.
Unless Apple starts kneecapping their regular bar phones or comes in with a better price I don't expect them selling better than the Samsung Foldables in terms of bar phone vs foldable share.
You have been able to do this on Android for a while using Termux, Proot Distro and VSCode Server. I even did it once to host two Angular Frontends on Android to free up Memory form my main latop running the backend.
Did he shop at the kid's isle?