Friction, in simple terms is a force that opposes motion. It occurs when two surfaces are in contact with each other. Friction occurs due to the roughness of the surfaces in contact. Even if the surface seem very smooth, it is not so at micro or nano scale. A microscope can reveal the roughness of a surface. A kind of interlocking occurs between the irregularities of the surfaces and hence a resistive force develops. This is why a book stops after gliding for some distance on even a smooth glass table.