I recently quit my job over this exact thing. I am (was) the highest producer in my department for a certain metal part in my whole department. My department consisted of 4 different machines and ran 3 shifts. The next highest producer in my department might have 70 to 75% of my production for the year. I found out one lazy ass, who's output is less than half of mine, makes a dollar more that me.
Found out this past summer a new coworker fresh from school was making close to my salary (I have 10 years of experience). Short of it I got a promotion and salary increase out of it, wouldn't have been able to expedite it if I hadn't had that talk with the new coworker!
Sadly, my contract prohibits discussing pay since it was written before the law that disallowed employers from including such clauses was a thing. Stuck with it until they have to alter my contract for any reason.
Don't get me wrong, I still do it anyway. However I can't do so as openly as I'd like other use they can and will cause a stink about it (as they've done in the past when I wasn't careful enough with who I discussed it with)
Where a contract entered into before 7 December 2022 has pay secrecy terms that are inconsistent with these rights, and the contract is changed after 7 December 2022, these rights apply after the contract is changed.