A cavity lining under a composite resin restoration is used to

minimize irritation of pulp tissue

prevent pigments in the composite resin from staining the tooth

protect the restorative material from moisture in the dentinal tubules

bind or adhere the composite resin to the cavity wall