but how do the authorities know that car A is an Uber car
In London Uber drivers have to hold a hire car license. Every single one of these cars is on file with TfL to start off with.
What they do not know at present is how many passengers it is carrying from A to B. There is a significant competition issue with them knowing it by the way as they can at least in theory fine tune the license fees, congestion fees and the TfL ticket pricing to ensure that public transport has a competitive edge.
They can of course do it in an easier way - just deliver f**** working transport, but that would not be the proper way of doing things around these parts.
As an example the distance between Barcelona downtown and St Cougat is roughly the same as between King's Cross and Potters Bar. So what does a Barcelona commuter get? Trains every 6 minutes, price of 3.10 Eu for a one way ticket and trains from 5 am to 2 am, train arrives bang downtown in 20 minutes. What does a British commuter get - trains every 20 minutes (not 6), price of EIGHT TWENTY and the train somehow manages to be slower - 25 minutes.