Price is always a factor, but I believe the most influential factors are time and availability.
If I did all our grocery shopping at one supermarket (the one that does not buy from small suppliers), I would save myself a great deal of driving, looking for parking, and hiking around snow-clogged streets and/or parking lots. Of course, if I did that, we would eat only what the supermarket sells, such as bland, unripe strawberries from California, even in July, and flabby, greasy chickens that just don't taste of anything much in particular. I can take the time to go to the market and the specialty butcher who buys from local producers because I don't have other obligations to eat up what my job leaves of my life.
I also live in a big city with several farmers' markets (and more to come), surrounded by a significant agricultural area full of forward-looking, entrepreneurial farmers and market-gardeners who bring their products to market close to me. If I lived in, say, Timmins, Ontario, my options would be considerably less opulent -- in fact, it would be the supermarket or nothing.