Purpose of liners and bases is/are:
Many restorative dental materials that provide excellent properties for the bulk of a dental restoration may not protect the dental pulp during setting or during cyclic thermal or mechanical stressing. Pulpal protection requires consideration of:

Chemical protection.
Electrical protection.
Thermal protection.
Pulpal medication.
Mechanical protection. 

Liners and bases are materials placed between dentin (and sometimes pulp) and the restoration to provide pulpal protection or pulpal response.
Pulp protection from thermal and chemical agents
Pulp protection from mechanical and electrical agents
Pulp medication
All of the above