Barter system predated money. Money systems were created because you can't cut enough grass directly to buy a car but you can have someone give you money for cutting their grass to trade for the car when you've cut enough lawns.
Barter wasn't meant to answer the questions you are asking. It was a way to trade what you had for what you wanted.
BTW: US Tax code actually addresses barter transactions too by forcing you to place fair market value for the trade and taxing based on that equivalent transaction
Star Trek's economy and a barter system are very different. A barter system is based on Person 1 having, say, a bunch of chickens, and trading their eggs to Person 2, who has a bunch of cows and is trading their milk. Or maybe to Person 3 for a car. Either way, each person has something extra they can trade, and they put a certain value on that thing, and trade for an equivalent value of what other people have. There is a limited amount of "Stuff" in the economy, and it
has to be traded for survival, or the ability to have things.
But in Star Trek, no one
needs to trade, because they can just go to a replicator and get their eggs, or milk, or car, or robot mower, whatever. Why should Person 1 give up their eggs to Persons 2 or 3, when they can go get milk or a car for free? Ok, so maybe grass-fed cow milk is a luxury that tastes better than replicated stuff. So you trade for it, but
you don't have to. All essentials are available to everyone, and everyone can have a happy healthy life without effort. Anything beyond that is for personal fulfillment - whether you decide to create art and trade for delicious real milk, or become a chicken farmer to trade eggs for real milk, it's something that you
choose to do, not because you gotta get your dollar a day to pay for things.