It depends - Each grocery store chain is different.
Most large chains deal exclusively with large produce suppliers and ship directly from the farm to the distribution center, then to each store location several times a week.
Some chains use a mix of a distribution center, local distributors (third party) and local farmers.
Some small chains deal just with local distributors.
Very few if any deal exclusively with local farmers.
But you may be surprised how many large chains bring in produce directly from local farms.