It's generally both - they're getting both American and foreign taxpayers to pay for their stuff.
> And doesn't the foreign location usually make money from the base being there?
If you're only looking at the direct impact of the base, sure, it tends to mean there are a bunch of young American men with money to burn around (though they also tend to be a not entirely positive influence in terms of e.g. sexual assaults). But the full package of obligations that goes with it tends to add up to something that's costly for both sides, and the people with the supply contracts are the only real winners.
The american taxpayer only benefits insofar as they are goven crumbs so they do not revolt or use what little democratic control they have to reign in the beast.
From the point of view of the rest of the world, there is nothing really to distinguish the US from the CCP other than the CCP are slightly more forward thinking in some of their projects in terms of long term benefit to themselves and are (momentarily) more brutally authoritarian. On the US side the main downsides aee they're currently dominant and there is a real danger of the US being taken over by a literal apocalypse cult that seeks climate change as an end to seek rather than merely something to be ignored where possible as the current incumbents do.
Other than that, one imperialist is the same as another -- to some degree even for the other countries in the imperial core.