We all know guys from both those camps, so something must be up.
I think a lot of guys get trapped in this cycle between their own lack of confidence and predatory companies that look for that sort of employee to exploit. I mean, what better employee to have than one who's constantly in fear of losing his job in the next round of layoffs and will happily work long hours for "market average" wages in the quest for job security.
That developer, when he hits the market, will hit it via a layoff. And he'll have four years of his last employee reinforcing his lack of value, so he won't expect much beyond a desperate search for somebody, anybody who will hire him. That's not the sort of dude who will network his way into coffee with your CTO. He'll pray and spray resumes at HR and endure half a year of being rejected by keyword filters. By the time the next exploitive company finds him and offers him another death march at a "market average" salary, he'll be so grateful that he'll never want to leave.
You see that guy here from time to time (though more often at Slashdot and Reddit). I wish there were a way to get through to him to let him know that it's really not like that.
Programming computers for money is the single greatest profession in the 21st century. If you're doing it and you're not happy, know that you can fix it.