Classical conditioning and attachment
A child learns to associate their caregiver with their needs being met (feeding them) so an attachment is formed.
The stimulus of food (unconditioned stimulus) produces pleasure (unconditioned response).
The person providing the food (usually the mother) becomes associated with this pleasure and therefore changes from neutral stimulus to a conditioned stimulus.
As an attachment is formed, the food giver becomes a source of pleasure (conditioned response) regardless of whether they provide food or not.