It seems there’s hardly a situation where an underlayment beneath could be considered a bad idea. An underlay really can only help your flooring by reducing sound transmission, prolonging its life, and keeping the floor level. The more apt question might be: Which type of underlay do I need?
In general, flooring underlay is added on top of the subfloor to provide a nice, even surface for the finish flooring. But there are several other benefits to using an underlay. Underlay reduces floor-to-ceiling sound transmission. It literally acts as a sound barrier against that clickety-clack of shoes tramping up and down the hallway or in and out of the kitchen.
Underlayment is also available with a damp proof membrane (DPM) which rests between your floor and the subfloor below. This membrane prevents moisture from attacking your floor from beneath.
NOTE: If you are installing a new floor, of any type, onto a concrete slab you MUST use a damp proof membrane. Not only will this vastly improve the durability of your floor, but failure to do so may void any warranty on your flooring.
There are different types of underlayment for different types of flooring. Sometimes they are interchangeable, sometimes not. For a tile floor you want a very rigid, very level underlay. That is why cement board is necessary. Wood expands and contracts far too much for tile and will result in cracking or corners protruding at uneven angles. Obviously with carpet you want foam padding, but not only for a softer feel, it also protects the carpet from premature wear by acting as a shock absorber. For laminate flooring you will want a foam, floatation padding.
These are only very general tips. For any particular type of flooring there are a slew of options for underlayment. You need to choose the underlay that works best with the location of your floor, your specific flooring, and your lifestyle. Your local retail outlet or your flooring contractor should be able to guide you and answer any questions or concerns.