Customs officers generally make a judgement call. They want to know that you will be in the country only temporarily, and that you will not try to work without a work permit. I often arrive in countries with no local cash at all, but I have a bank card where I can withdraw cash on arrival and that's no problem. If you have no cash, no credit card, and no bank card, how will you eat? Where will you sleep? They begin to suspect there is something you are not telling them.
On the other hand if you arrive with $10,000 in cash, that will draw attention for other reasons. They want everything you bring to make sense and match with everything you say. You're not planning to work? Then why have you brought your special tools that you use for being a welder or a hairdresser or a fashion photographer? You're just here to visit a friend? Then why have you brought all the clothes you own, family photo albums, and a collection of "we'll miss you!" cards from friends and family? How much money you have with you fits into that thought process as well.
There is an aspect of unfairness to all this, because it's not as simple as "bring $X and you're all set." It is a judgment call. Laws say things like "enough money to meet your needs" but obviously different people have different needs, and different lengths of trips, and different support from friends and family. Nothing is ever cut and dried at borders. And then there's even just the matter of whether they check. If you're well dressed and are carrying credit and debit cards along with stuff that suggests tourism, you'll be treated differently than if you look like a hippy and are carrying only one debit card and some pot smoking paraphernalia. Once you're in secondary they can check your criminal record, search the contents of computers, call the people you're visiting and so much more that they would never do at primary. And then they might conclude they don't want to let you in. I've watched many episodes of Border Security (I watch the Canadian one, but there are versions all over the world) and listening in on them discussing how much money someone has it's clear there's no obvious number you know you're ok as long as you have. It's an overall presentation: logically, does what you are saying make sense and hang together? If not, and they decide you're arriving to work then they won't let you in. If you're wandering the world with no clear ties to some other place, they might decide you want to stay here without applying to do so, and then they won't let you in. Etc. You want to make sure you get across to them the truth of your situation, and it had better make sense.