Sigmoid has three problems as a hidden-layer activation: it saturates, causing vanishing gradients; its output is not zero-centered; and it is relatively expensive to compute.
Saturation is the big one. For large positive or negative inputs the curve is flat, so its derivative is close to zero, and even at its peak the derivative is only 0.25. Backpropagation multiplies these derivatives layer after layer, so in a deep network the gradient reaching the early layers shrinks toward zero and those layers barely learn.
Because sigmoid outputs are always positive, the gradients for a neuron's weights all share the same sign, which pushes updates into an inefficient zig-zag. That is why ReLU and its variants replaced sigmoid in hidden layers, and tanh is preferred when a bounded output is needed. Sigmoid is still the right choice in the output layer for binary classification and inside the gates of LSTMs and GRUs.
Tanh, tanh(x) = (eˣ − e⁻ˣ) / (eˣ + e⁻ˣ), squashes inputs into (−1, 1) instead of (0, 1). It is a rescaled sigmoid, tanh(x) = 2σ(2x) − 1, so its outputs are zero-centered, and its derivative, 1 − tanh²(x), peaks at 1, four times sigmoid's 0.25. That is why tanh trained better than sigmoid in hidden layers before ReLU. It still saturates: the derivative is about 0.07 at x = 2 and 0.0099 at x = 3. Tanh lives on inside LSTMs and GRUs, which squash candidate states to (−1, 1), and in the output layer of image generators such as DCGAN.