A friend of mine is a 5th generation dairy farmer. Property is in Gippsland, Victoria.
Even with him explaining the industry to me, I still don't understand how I can go into my local store and buy 2L of milk for less than 3$ having seen the work that goes into producing it. Economics make absolutely zero sense to me.
There are two parts to the answer here.
The first is that milk is regarded as a known value item within the retail trade. That is, as a staple item customers will tend to consider those stores that sell it cheap as being good value stores to shop at. Supermarkets know this and may actually sell it at zero, or less, profit to draw the customers in. This is often referred to as a loss leader and helps account for the low price of milk.
At the other end of the chain there are farmers who are trying to produce the stuff at a profit but they are hamstrung by the fact that unless they also retail it into the local community, or add value by making cheese or butter, they have no control over the price they receive for it, not over here anyway.
Milk is traded on a global basis with dried milk powder being one of the major commodities by which the price is determined. Thanks to a baby milk contamination scandal in China many years ago, the demand for trusted powder comes mainly from the east and if China stops buying then the milk price plummets everywhere and we have seen something of that recently.
However, dairy farmers do have more control over their input costs and so they constanly seek to reduce them. One way is through the economies of scale which is why we have seen herds grow ever bigger. More efficient production is another goal of farmers and this has grown tremendously as well, with fewer staff and machines producing more milk off the same land area.
Unfortunately, those machines have got more expensive, which neatly leads to the point that the suppliers of farm inputs will know the margin that farmers are working on and will price their products accordingly. One major tractor manufacturer boasted to its shareholders last year that it put its prices up simply because it could, I think it might be regretting that claim now.
This is only scratching at the surface of the complexities of farming and the food chain in general, yet at its core the reason we enjoy relatively cheap food, measured as a proportion of household expenditure, is because the retailers have put pressure on farmers to reduce costs and the farming community has, to a large extent, responed by becoming more efficient.