After retirement from the Army, I lived more than a few years in Michigan, Illinois, Tennessee, Missouri, Ohio, and Mississippi, far removed from military installations. In Utah, where I lived for 4 years, I had to drive 40 miles one-way to get to Hill AFB. I didn't find it necessarily advantageous.
Chasing after jobs is the basic reason for moving around like that.
But here in Arkansas, I live about 5 miles from Little Rock AFB -- the home of the C-130 aircraft. LRAFB is small and I do not use the commissary or base exchange that much. Price differential is essentially zero, even when you consider there's no sales tax. But the base pharmacy is a definite advantage -- I pay zero for my meds.