At least at the farmers markets in my area there is very much a mix of the "local farmer selling produce they grew themselves" and the "retailer buying produce from the exact same distribution channels as grocery stores".  Sometimes there is a bit of overlap between the two, particularly in winter or spring when the local farmers just don't have much in season to sell, but for the most part the two groups are pretty distinct.

... and it usually isn't all that difficult to tell the difference.