All of those are bad examples, because the latter form factor is better in every way except its ability to fit hardware inside. If you could make a laptop that contained the same hardware as a desktop, for the same price, then it would obviously be better. A decade ago, laptop sales outpaced desktop sales and so the economies of scale started to tilt things in favour of the laptop. As desktops become increasingly niche, the prices will keep going up and a lot of desktops now are just laptops without the built-in screen, keyboard, or battery.
If you take a desktop and scaled everything down so that you had the same amount of storage, CPU and GPU power, and RAM in a laptop form factor, for the same price, then obviously the laptop is better for most people (people who need PCIe slots being the exceptions).
If you took a laptop and scaled everything down so that you had the same amount of storage, CPU and GPU power, and RAM in a phone form factor, then you'll have a very powerful phone, but it won't replace a laptop. There are a lot of things where you can open up the laptop and start working immediately, but the phone will need connecting to an external monitor and keyboard before it's equally useful. Even putting a picoprojector in the phone won't entirely solve that, as you often don't have a useable projection space.