To be fair, the tech job market is in a pretty shit position right now. For many people it's not possible to leave their current job, even if they hate it (ask me how I know).
For a lot of them, absolutely. Not all though. A lot of tech companies have been cutting back lately, and it’s pretty rough out there for certain roles. I know a lot of people that have been sticking out jobs they hate for a year+ while they interview and try to find something with similar comp.