This even applies internally, if your customers are other parts of your company.
MaxCompensation = UnitValue * NumberOfUnits
In tech companies, NumberOfUnits is commonly one million+.
In non-tech companies... it's much less.
So either deliver more value (petrogeology simulations!) or work for a specialized company that services multiple clients (healthcare software!). Be aware the former can be morally onerous, and the latter craven to protect their (relatively few) key clients.
That said, if done right, I find it way more interesting. Solving problems in {x field} with software means you get to learn about {x field} and software!
Just be sure to self-motivate on keeping your skills up to date. It's easy to get complacent and rust, given there's not the same competitive tech pressure (for better and worse).
With respect to algorithms - nobody starts out good with them (except Knuth), it takes practice. Don't give up. Also recognize Leetcode for what it is - practice. It's okay to do a problem poorly/not figure something out. It doesn't actually determine anything about your intelligence or trajectory in the field.
I spend most of my time coding on side projects, so as it turns out I'm not great at algorithms. Recently I've learned that I can only really do easy problems on Leetcode/codeforces etc, and I've been trying to improve.
Thanks for the advice!