Wasps are able to use reasoning called transitive inference to avoid getting an electric shock. They were trained to learn five colours labelled A B C D and E and then the colours were presented to them in pairs, one of which would give them a shock if they landed on it. The colour giving the shock would be different though, depending on which of the two were in each pair.
Bees can't do this although their nervous system is a similar size to wasps. It is thought the reason they can't is to do with their different social behaviour, not on the size of their brains.