Are you being deliberately obtuse?
The machine doesn't replace the farmer, he owns the means of production. If the machine replaces a person he used to hire for that work, then the employee it is replacing who is starving, not the farmer.
Farmer A has three employees to do X work. Farmer B used to have 3 employees doing X work, but now has a robot to do X work for the cost of 1 employee. Both accomplish X work, but Farmer B is saving money by not paying for people.
In this scenario, 3 people now do not have work, and, because there are no social safety nets, cannot afford to feed their families.
Because he has a lower production cost, Farmer B then sells his X for cheaper in order to drive Farmer A out of business. An additional four people (A plus his 3 employees) are now out of work and cannot afford to feed their families.
But there is still the demand for 2X, so Farmer B buys another machine to replace Farmer A's business. He's now paying the equivalent of 2 salaries. With Farmer A out of business, he can increase the cost of the product however much he wants: people need X, they will find a way to buy it. Farmer B quadruples the price of X, despite the fact that he has 1/4 the costs. He becomes a millionaire while people who need X to survive are forced to pay more for it.
And that's even without the added wrench of B's machine-made X being of inferior quality, which is definitely what happens between steps 2 and 3 in order to cut more costs. Consumers get screwed, employees get screwed, one person benefits.
It is definitely more efficient/cost-effective for 2 robots to meet the demand of X than 6 employees, but under the current system (capitalism), those 6 people need to work. No matter what industry it happens in, if we replace working people with robots without alternative means for those people to survive, people literally die (or live in abject poverty) while one person hoards all the wealth. Eliminating competition (creating monopolies) hurts everyone under capitalism.