Marx applied labour theory not only to goods, but also to the value of labour power.
Q: What determines the value of labour power?
A: It is determined in the same way as other commodities: socially necessary labour time involved in its production.
Therefore, the value of workers' wages are based not on the value of what they produce, or what society arbitrarily considers their worth.
Rather, it is what it costs - in hours labour time - to produce and reproduce it on a regular basis. e.g. the cost to feed, clothe, shelter, educate, etc.
(+/- influence of struggles, strikes)