There are food distributorships like Grocer's Supply and formerly Flemming (used to be the biggest, now bankrupt). These suppliers/distributors buy from the manufacturers and then sell to the grocers (both chains and individual stores).
Some chains have their own distributorships built into their plan and buy direct from the manufacturers, like WalMart does (one of the fastest growing grocers).
Very few grocers buy directly from the manufacturers, as this would entail hundreds of transaction a day to get new stock.
This does not apply to a few key segments of the grocers inventory, such as Brand Sodas, Potatoe Chips, Beer & Alcohol, Drugs, and certain "hard groceries" (like mops, school supplies, cosmetics, etc). These are usually done by separate distribution networks other than the normal grocery supply ones. Coke, for instance, has local (state) distributors that visit each store, take inventory, deliver and setup/stock the shelves for the grocer. This is similar with all the special segments I stated above.