What does ‘That hits the spot’ mean?

Usually spoken in conjunction with food or drink, you can say something hits the spot to express that it was exactly what you needed.