Friction is a contact force that acts opposite to the motion or tendency of motion of two surfaces in contact. It arises due to interlocking of irregularities on the surfaces when one moves over the other. There are three main types of friction: static friction between non-moving surfaces, sliding friction between moving surfaces, and rolling friction between a rolling object and surface. Friction has both advantages, such as allowing movement, and disadvantages, such as causing wear and generating heat. It can be controlled to some degree by lubrication, surface smoothness, and other factors.