Hitchhiking in the sense of getting into a private car that just happens to go the same directions and has no commercial interest is NOT a thing in Cuba, are at least not the norm. Not many people own their own car in Cuba and if they do, they use them mostly commercially.
What they are probably referring too are cooperative taxis. Those are cars or smaller buses that are driving a certain route, like a bus. They don't have fixed stops. You just go to a street that is part of their route and wait for them to drive by and hail them. You get on, pay a small fee and tell the driver when you want to stop and go out. Think low tech Uber + ride sharing with strangers.
They are super great for getting around comfortably for cheap.
Saying the public transport in Cuba is bad makes no sense. Basically nobody owns a car in Cuba and people still get around just fine. Of course because of the economic blockade against Cuba they are forced to be creative on how to use the available resources.
As someone that has lived and studied in Cuba, feel free to ask additional questions. The amount of misinformation really grinds my gears.