In California for example, the equal pay act requires 'equal pay for employees who perform “substantially similar work,” when viewed as a composite of skill, effort, and responsibility.'
https://www.dir.ca.gov/dlse/California_Equal_Pay_Act.htm
Someone who contributes more inherently must have greater skills and/or put in greater effort, and likely greater responsibility, given they are accomplishing more tasks.
You can pay differently based on a seniority system, a merit system, a system that measures earnings by quantity or quality of production, or another bonafide factor such as education, training or experience.
Here's a copy of that law, it's pretty short.
https://leginfo.legislature.ca.gov/faces/codes_displaySectio....