"I'm not paid what I'm worth." Who hasn't said this at least once? I certainly have. But if we subscribe to classical economics which says that the price paid for any given service is the price at which the quantity supplied equals the quantity demanded, aren't we paid precisely what we're worth? And if we still believe we're trading at a discount to our intrinsic value, is it possible to change the market's mind?
Salary surveys, talking to other people in similar positions are reasonable starting points. In my opinion, getting a competitive offer now and again (by interviewing elsewhere) is the easiest way to make sure that you're being adequately compensated.
I am not sure if you are looking for a more abstract or philosophical answer, but I'd say benchmark it. I use AngelList's talent product when trying to figure out what the market rate (in my area) is for a giving skill set. It is a great tool for hiring, but similarly a great tool for talent looking to understand what their skills are worth.
I've been a freelancer for more than 25 years and one thing I can tell you about this topic is do not compare your fees to others. You'll always find someone who gets more for less and this will tick you off. I made a point of asking what I wanted and NEVER ever tried to discover my colleague's rates. It's not about price it's about value ... And whether you do. Calculate what $ you need and want then ask for that. The rest be damned. That's their issue - not yours. I assure you that this approach will make you happier and more content. Sure sometimes you'll find out someone got more than you - so what? Big deal. Ask better next time.