Specifically, Upwork charges the freelancer a fee of: 20% for the first $500 billed with the client. 10% for lifetime billings with the client between $500.01 and$10,000. 5% for lifetime billings with the client that exceed $10,000. For more details you can read this article Freelancer Service Fees
Upwork receives a percentage of what is charged to the client, based upon your total earnings with each client.
This is based on lifetime earnings per client (not overall). More information can be found at https://www.upwork.com/i/how-it-works/freelancer/#get-paid under the "What fees do you charge freelancers?" header.