Friction is the force that opposes motion between two surfaces in contact. It occurs when one surface slides over another, causing resistance and heat due to the roughness or irregularities on their surfaces. Friction can result from the interaction of various forces such as mechanical, fluid, thermal, electrical, and magnetic forces.