Grafting is the process of joining a stem, scion, from one plant to a root structure to reproduce a plant. It is used because some fruit, like apples, do not grow true to seed. If you plant an apple or pear seed you will get a tree, but not the variety the seed came from and there is no guarantee that the tree you get will have desirable fruit. To reproduce the variety you want, you take a piece of the desired tree, a scion, and connect that to an existing tree or rootstock selected to produce the size of tree you want to have.
There are several kinds of grafts. They mostly all basically connect the cambium layer of the scion to the cambium of the rootstock. The cambium is underneath the bark and is the layer of the plant that grows. When the two cambium layers are touching, they will grow together and the scion will grow out to be the desired tree.