SillyChicken hit the nail on the head. It's basic economics. A producer can/will charge what the market will bear. I live about thirty-five minutes north of a very large college town. At the farmers market in town, eggs might sell for $3-4 per dozen. Twenty-five miles away it's more like $2-$2.50. There is one farm that sells them for $1.25 (cheaper than the grocery store). The "certified organics" sold at the farmers markets aren't even that good. Other than the fact that they're brown, they look like they could have been laid by a battery hen (yolks not thick and bright yellow/orange). The problem is, the farm that sells cheap is a working farm (dairy) not some bucolic scene from the "Sound of Music", I think. That and it's a little out of the way.
It's like that with most agricultural products though. For instance, early in sweet corn season the price gap is huge. I used to work for a bank in town that was probably the most popular among the Amish in the area. Their deposits during the height of the farmer's market season were pretty amazing sometimes. In fact, certain branches would stay open 30-45 minutes later some days so they could close out the market and come make their deposits. I don't consider it taking advantage so much as application of simple economic principles.