I do not understand how are they illegal and still able to function?
It's usually thought to be a good thing that not every crime is punished - most people would be in jail if they were.
See also: brothels. They are also illegal to run, but he police in some places take the view that they'd rather have brothels they visit to check all is well there. (This applies to every single gay male sauna - also legally a brothel - for example.) Even when they don't do that, the number of places that are brothels far exceeds the police resources available to close them.
What makes them illegal but not a sole prostitute.
The people running it - but not the escorts or clients - are committing the crime of controlling prostitution for gain. If they go 'no experience required' etc, they also risk being guilty of causing or inciting prostitution for gain.
Single prostitutes can gain from their own prostitution.