Success at work is no guarantee of happiness, but lack of success is a fairly reliable way to be unhappy. It's definitely true that pouring your life into a company owned by someone else is not a great way to feel happy, but also, you're there 8 hours a day (or more) 5 days a week (or more), poor performance endangers a lot of things low on Maslow's hierarchy of needs like affording food and shelter, and you're surrounded by humans who are unintentionally bombarding you with a value system.

I am generally pretty happy (in a long-term sense), and to be honest, I'm unemployed and job-hunting at the moment, hoping to sign an offer this week. I certainly make far less than $1M per year. I quit my old job because I was unhappy there and starting to be unhappy when I went home, too: I was working long hours and trying to be very good at what I did, and I didn't get the sense that people around me (and my management in particular) valued the things that I was trying to be good at. That is, to be clear, not a criticism of management: they needed different things out me than what I had gone into the job expecting them to need. But it took me a while to really get to terms with how much I had let my sense of self-worth become defined by the value system in place at my work, even though my engineering skills and mindset had remained largely as they were. That dissonance got to me very badly.

I think that's the risk with trying to be happy by being successful at work: it's always an external metric. You can be very successful for years, and laid off the next day, and you always know that in theory you can be laid off the next day.

The things that make me happy now are all internal metrics, that is, they're accomplishments that I myself see as accomplishments, instead of hoping my management will acknowledge. I'm happy about the friends I have, about how much I've been cooking instead of ordering food, about how I've been getting better at singing, about the job prospects I have, about this video game I've been playing, etc. Some of them also have external measures (my voice teacher also says I've been getting better, the video game is letting me advance to new areas, etc.), but I can tell for myself whether I'm doing well or not, and - importantly - I'm continuing these things because I find them enjoyable, not because my voice teacher or the video game says I'm doing well.

Regarding money: on the one hand, I have enough savings that I could just quit my job and start job hunting, and that definitely made me happier than job hunting while staying at my job. On the other hand, I'm expecting a significant increase in compensation regardless of what offer I sign, and I don't think that's made me noticeably happier; I already have enough money that I can do things like quit my job without a new one lined up. I do think that you can feel unhappy from a sense that you're underpaid, but that again ties into external metrics: you know you're doing a job worth some amount, but you're being told it's worth less. I don't think being overpaid (for the work you do) is really going to bring you happiness, unless you have some plan to save up money and quit - and some plan for what to do with that money once you do and why you believe you'll be happy doing it.