A cavity lining under a composite resin restoration is used to

protect the restorative material from moisture in the dentinal tubules

minimize irritation of pulp tissue.

bind or adhere the composite resin to the cavity wall

prevent pigments in the composite resin from staining the tooth