A good night's sleep can make a good trip great, and that will depend on your shelter and sleeping system; tent, sleeping bag, and pad. Sleeping bag ratings are based on this setup, anticipating that the bag will be protected and you are isolated from the ground. Many different things can insulate you from the ground, but a purpose-built pad is the best.
Insulation works by prohibiting heat movement by conduction (direct contact), radiation, convection (flow resulting from direct contact), or evaporation. An example: If you were to lie down directly on a large rock with no wind protection or cover, the rock would feel cold because it is conducting heat from where your body is touching it, and as the wind blows across you, the heat you are radiating would be lost. The thermal resistance of any material is expressed as its R Value, with a larger number meaning more resistance.
The two main sleeping pad types are foam and inflatable. The majority of inflatables use foam as well, and are referred to as 'self'inflating.' In either case, the goal is to provide comfort by reducing heat loss through conduction to the ground and padding to take the corners off the rocks.
Foam pads are just what the name implies - a piece of open- or closed-cell foam cut to shape and size to sleep on. Open-cell pads are essentially sponges, and will usually have an 'eggshell' surface for comfort and a cloth cover to keep the foam from getting dirty. These pads should be avoided unless you are completely certain they will never be used outdoors. A much better option is a closed-cell foam pad which is very durable, lightweight, will not absorb water or dirt and can be trimmed or modified easily. They are also the least expensive, even for a quality pad like the RidgeRest from Therm-A-Rest. The foam will be relatively thin (3/4in), and does not compress, so the rolled pad will still be bulky, but when loaded correctly will not affect the balance of your pack.
Inflatables pads for backpacking are built by welding together durable nylon fabric to create air chambers, but they are not pool toys - don't try to float on one of these. They tend to be thicker when fully inflated than the other styles of pad, can be adjusted for softness by letting air out, and pack down to a very small size, but can feel colder than the floor because of convection. This results when the mattress is placed on a cool surface that begins to conduct heat out of the pad. When you lie on top, you conduct heat into the mattress and the air inside begins to circulate, moving from an area of more heat (you) to less (the ground). To address this, newer inflatable pads incorporate high-loft insulating material in the spaces that reduce or eliminate convection. The construction is very durable, but keep in mind that any puncture will result in a useless pad.
Self-inflating pads are built with open-cell foam inside a sealed envelope of nylon fabric, and combine the adjustability of inflatables with the padding and convection-defeating properties of foam. They are considered 'self-inflating' because when the air valve is opened, the foam expands, pulling air into the pad, but still must be 'topped off' by mouth. Once full, air can be released to 'soften' the pad, but keep in mind that when you roll on your side, the foam will be compressed and you may experience cold spots at the hip and shoulder if the pad is too soft. If punctured, the foam still provides some padding and insulation. Self-inflating pads have been around for over 40 years, with many variations in thickness, size, and foam treatment available.
When shopping for a pad, the first step is to define how, where, and when you will be using it. A lighter, more compact pad will be easier to bring along on many trips, but will be more expensive and less durable than a light-but-bulky foam pad. The durability of the foam will be offset by the inability to adjust softness.
Once you have a specific type in mind and start comparing them, be sure to match size, weight, and R Value to be sure you've got apples and apples. As a rule of thumb, the R Value will increase with thickness and weight, decrease as you get down to the smallest packing size and weight. The length of the pad can be important when you are trying to conserve weight or increase comfort, since a 3/4 length pad will only reach to just below the hips, but a Long will give taller people (or active sleepers) more insulation and padding.
Whatever your priority, keep in mind that the value of quality will remain many good mornings after the satisfaction of savings fades.