It's simple: Bad Engineering is cheaper.
Just today on Patreon, I was going through a creators posts. After about 100 posts or so the page was barely usable. Animations took minutes to complete, loading more posts took 30 seconds and Firefox (Chrome quit after 80 posts when Linux' OOM decided that the fun was over) was struggling to repaint the view port, lots of white areas. At the end other applications were severely lagging too both because Patreon's webshit was pulling 80% of all cores when doing nothing on the page and the Linux kernel was shoveling everything into ssd swap like crazy. Animations didn't work at all (likely if I waited 60 minutes it would have shown the first frames) and clicking on links to open in a new tab took about 15 seconds until the JS behind the scenes completed.
It's simply shitty design that there is no obvious way to say "show all posts from January 2016" and jump back month by month. Or atleast UNLOADING posts I've long scrolled past.
I have 8 Cores and 32 GB of RAM at my disposal, a website has no excuse to have that much of a shit performance. Especially when it's a platform where lots of money flows.
But hey, it's cheaper this way.
---
The issue is not thread priorization. Or processes. Your mail app and android studio are both competing for resources and either android studio will lag because the mail app is running on all the CPUs or the other way round. The OS doesn't have a way to tell which is more important and trusting applications to tell is not really reliable (devs will just say "I'm the most important").
A real partial issue is that a lot of modern apps are not engineered to save resources. They just take what they need and the user better provide enough CPU and RAM to do it. There is no sense in self-limiting in a lot of modern apps.
Frontend devs should wake up to the reality that they aren't running on the only instance of the chrome browser with only one tab open. There is other apps around too. There are other browsers around too. Sharing resources gives the user a better experience than just taking them all for yourself.