I think most people know what they are worth - as I said at the beginning, personally I don't care what others, doing the same job as me are earning. That doesn't mean I don't know what I am worth to a business. I take this into consideration when I am negotiating. So if the average salary for the job I do is, in my opinion, around the £40k mark and I am happy at that salary then that is where I am going to be happy.
If I subsequently fine someone else doing the same job as me but earning £50k then I'm not bothered - I am at my market rate, or rather what I perceive is my value to a business and I am on a salary that I am happy with.
What my mate was effectively saying was that if I'd valued myself at £40k, and I was happy working for £40k, then the realisation that somebody else was on £50k for the same job would be devastating to me and be the cause of numerous nights without sleep - which I very much disagreed with.
Of course the salary I'm happy on is going to be "within the expected salary for a person doing my job". I'm not going to be happy doing my job for less than I want and I want to be earning a good, fair salary. I'm just not necessarily bothered if there are others doing the same job as me, earning more money.