The basic concept of bonding to enamel and dentin is essentially an exchange process involving replacement of minerals removed from the dentin by resin monomers, which, upon setting, become micromechanically interlocked in the created porosities.
Source: wiktionary