When are multiple hidden layers necessary?
A very wide but shallow neural network is going to be harder to train.
You can check that with the playground of tensorflow or with the MPG example in Google Colab.
The relationship between architecture and learning capabilities is not fully understood, but, empirically, thats what you see.
But making the network too deep creates more problems:

Vanishing gradients.
Less parameters for the same amount of neurons.
Exploding gradients.

It is for that reason that humans and neural networks are the one deciding a good architecture.