@antimatter I think the assumption is that in the Star Trek version of Earth, people work on what they show an aptitude for, and somehow this translates into everything the people need being produced and delivered where required. So, it’s like communism, except that it works.
I’ve always wondered what happens in, say, cafes and restaurants (which we see on Earth occasionally) – do people just get up after their meal, say thanks to the server, then leave? If so, why do we never see that happening?
But the point I was making above is that there are many, many occasions where Federation members need something they can’t get from the usual sources, and have to barter with aliens. Sometimes, the Federation is described as using no money, but other times, there are references to currency in the form of “credits”. Often, and especially if a Ferengi is involved, humans are made fun of because their idealistic system becomes useless the minute they have to deal with another culture. But obviously, Quark charges for drinks in his bar… and Starfleet officers drink there. Who pays for that, and with what?
The writers couldn’t stay consistent, because sometimes people just needed to be able to pay for things. It’s kind of the same writing problem that exists with everyone having a replicator. So many storylines revolve around the procurement of some… thing. What, you can’t just replicate that?