This does not happen all the time. If the cost for just transporting the crop to the market is more than the difference of the cost of the land and the selling price of the crop per land area, then there will be a net loss of money for a given land area.
Therefore, farmers must have:
Afarm that is close to the market
Crops that will sell for prices higher than the cost to sustain for the land itself upon which the crop is grown
Crops that fit number 2 and also has a low cost of transportation to the market.