They pulled out because they weren't making any money and the fast food joints moved in because they knew they could.
========================================
As a rule, supermarkets move because the lease is up. Someone new has bought the building and owes a sh!tload of money on it and wants to raise the rent. So the supermarket owner simply reevaluates everything and decides that can make more money in a new site, or perhaps with a different investment.
They are usually making money, they simply want to make more, or discover that the landlord wants to screw them out of their profits.
McDonalds moves in because they have some fatcat who wants a franchise. Many a McDonalds has failed, but the parent company does not lose, so they build the thing and let the franchiseholder try.