It would be a market where if you were unemployed,
but qualified, you could approach a company and
offer to do a job a bit cheaper than an existing
employee, and expect that the employer would sack
that employee and take you on instead.
I agree with the main thrust of what you're saying -- that truly free markets don't exist -- but this example is not realistic.
Depending on the job, there will be potentially-large costs with swapping out employees like you say.
- Even if 100% qualified for the position in general, the new hire is likely to be lacking in knowledge specific to that company/role. It will take them a while to learn how things work at that particular company. On something like a large software codebase, it might be quite a few months before their productivity matches that of the engineer they replaced.
- There is a "morale cost" there. When companies visibly treat their employees in this way (like instantly replaceable cogs) surely it has a negative effect on effort and loyalty among the remaining employees, who have been indirectly told that they are instantly replaceable cogs as well. There are any number of hidden costs here: reduced effort/productivity, the cost of replacing them if they leave due to reduced loyalty, etc. I don't have figures to back this up, but I think the burden of proof would fall upon anybody claiming otherwise...
Further, why do the most unpleasant, and not necessarily easy, jobs
often pay the worst wages?
This is often but not always true. A lot of maintenance jobs pay pretty well, often thanks to unions. Trash haulers can make very decent livings.
In general though, it's a function of how many people can do the job. Working retail is NOT easy, and is soul-crushing, but probably 98% of the workforce is capable of doing it, and the cost of replacing employees is small, so there's unfortunately little incentive to treat or pay those workers well.