You always want a switch unless you can only afford a hub.
A hub sends every signal to every port, so it can never send more than one signal at a time. One device talks, all devices listen.
A switch learns which device is at which port and only sends packets that will interest that device. Device A can be sending packet to Device B at the same time as Device B is sending packets to Device A. Switches often buffer packets better than hubs, reducing collisions to a rare event, they usually autosense the best speed and duplex a device can communicate at.
In theory, a 48 port switch could have 24 full duplex conversations on it while a 48 port hub could have 1 half duplex conversation. (obviously, the advantages of a switch grow with the number of devices attached)
One place you may want a hub is to snoop packets, with a switch you need to do port mirroring, if you are not snooping packets, a switch is better.
I tried to remain child-like, all I acheived was childish.