When I was in the Navy in Puerto Rico back when dinosaurs roamed the earth, we had an NEX about 10 minutes walk from our house. It had a great cafeteria (Arroz Con Pollo FTW) and better selection than off-base stores, but the prices weren't outstanding. The convenience was the thing. Fort Buchanan in the San Juan area had a much better Exchange than we had in Roosevelt Roads and we were envious.
When I was a DA civilian we were granted PX privileges a few years ago. Selection and prices were not nearly as good as the
Walmart Supercenter just off post. I would go to the PX when I needed something quickly and didn't want to go off post.
The Exchanges operate on a for-profit model and the profits are used to fund MWR activities. Now the Commissary (at least when I was on active duty) did not operate on a for-profit basis and the prices really were good.
Also, on the terminology discussion above, in my experience Navy installations are called "Bases," and Army installations are called "Posts." An Exchange on a Navy installation is called a Navy Exchange, or NEX, and an Exchange on an Army installations is called a Post Exchange, or PX. But commissaries are pretty much called commissaries everywhere. And I've never been to an Exchange on an Air Force, Coast Guard or Marine installation, so don't know about those. And I don't claim to have the only right answer here--just my experience, and I yield to others and their experiences.