This begins in A Fistful of Dollars, where The Man with No Name sells both his work (he offers his violent services to both families) and his body (he puts his life on the line), as well as the bodies of others (he kills people). He exchanges both body and labor for money. This is the trilogy's approximation of the baseline relationship between employee and employer under capitalism: we offer our work for monetary reimbursement, but we also lose something of ourselves, our life energy, our body. For this reason, The Man with No Name must leave the town at the end of the film. He cannot stay without some level of risk to his body. Capital is inherently unsustainable for its human counterparts.
This relationship shifts in For a Few Dollars More to a slightly different perspective. The Man with No Name (along with Lee Van Cleef, as Col. Mortimer here and as The Bad in The Good, the Bad and the Ugly) still offers his work in exchange for money (he captures or kills people for rewards), but the body on the line becomes that of the other (his compensation is for the death of the other, not the protection of the self). He is still an employee of sorts (although certainly a freelance one), but he has short-circuited capital's connection with his own life, taking on elements of an employer as well (he owes nothing to no one). Thus he remains in town at the end of the film, carting off his collection of the other bodies he plans to exchange for hard currency, a grotesque and violent symbolic approximation of the process of capitalism.
This relationship between money, labor, and bodies reaches its pinnacle in The Good, the Bad and the Ugly. This film offers us three characters, each of which has a slightly different relationship to these three symbolic points. The Good (Clint Eastwood) has a mutually beneficial relationship with The Ugly (Eli Wallach): he turns in The Ugly for a reward, but saves him at the last second, and the two men share the reimbursement. The Good uses his labor (he turns in The Ugly and saves him from the noose), The Ugly risks his body (he could die if The Good missed or decided not to save him), and they both get money. This relationship depicts a strange rift in the responsibilities of the laborer: only one of them has to work and only one of them has to put his life on the line, but they both get paid. This is a kind of utopian vision of a symbiotic capitalism in which the employer (The Good, who ultimately wields the power in the relationship) uses his labor to maintain the body of the employee (The Ugly).
The Bad is different. He's just a gun for hire, a man who kills other men for money. He stakes his body on the quality of his labor in exchange for money: if he fails, he could die, but he's skilled enough that it's worth the risk for him. This is essentially an echo of the freelance employee of A Fistful of Dollars, but with the slight twist that he wields power over his employers because of the potency of his labor (he kills a man that previously hired him, whereas The Man with No Name essentially sold his allegiance).
The crucial element that The Good, the Bad and the Ugly adds to the formula involves the introduction of the American Civil War. While on a technical level it provides evidence of Leone's continued plagiarism (after copying Yojimbo with A Fistful of Dollars, he's now copying The Bridge on the River Kwai), on a thematic level it becomes absolutely essential. It adds an existential dimension to the symbolism not found in either of the previous two films.
After the big final set piece—notable for how everyone except our three protagonists seems to be killed—The Ugly runs through a massive graveyard, looking for one specific grave in which he expects to find a treasure trove of $200,000. As he runs, the graves whizz by the camera, blurring until they become one solid mass. They represent a universal death: the blurring and the sheer size of the graveyard remind us that we all end up in the same place, no matter how much wealth we accumulate. The absurdity of looking for a single grave among thousands mirrors the absurdity of the trio's quest for this gold against all odds: through their labor they will risk their body, the ultimate good, for something as simple as money. While The Good rides off into the sunset with his money, his labor, and his body all intact, this graveyard scene is a bleak symbol of how we all lose these three attributes in death. These men have reached the top of the food chain, but ultimately it's the food chain itself that eats them. We consume through capital, but there's no escaping capital's own consumption of us.
Just kidding, I think we all know what really makes this movie so great.
Four stars instead of five because there were more than a few character beats that didn't work for me, and until the finale I thought I actually liked For a Few Dollars More better than this. I came around in the end, though: this is my favorite of the trilogy, and I'm all the more excited to see Once Upon a Time in the West.