Friction is a force that opposes the relative motion between two surfaces in contact. It arises due to interlocking irregularities between the surfaces on a microscopic level. Friction can be static, sliding, or rolling depending on whether an object is at rest, moving, or rolling respectively. The factors that affect friction include the nature of the surfaces, how hard they are pressed together, and their relative smoothness or roughness. While friction is necessary for important functions like walking and driving, it also leads to energy loss in machines. Efforts to reduce friction include lubrication, use of rolling elements like wheels and bearings, and streamlining shapes in fluids.