Friction occurs between bodies in relative motion, or tending to move. It always opposes the motion, but if the force tend to move the bodies relative to one another is sufficiently large, motion always occurs.
Friction occurs because surfaces are not completely smooth. The bumps in one surface tend to fit into the hollows of another surface. When a force is exerted, the bumps and hollows have to ride over each other.
The surfaces only meet at a few point. When a force is exerted, the pressure can be enough to 'cold weld' together points of contact. To break these welds you need a force.
The force can be reduced by using lubricants.
A car engined uses lubricating oil so that friction is minimised and the metal surfaces of a car engine never come into contact. The oil is selected to have a specific viscosity and heat properties, so that it has the required behaviour over a range of temperatures and pressures.
Friction results in energy losses. Energy is always lost when machines operate because friction cannot be eliminated and energy must be used to overcome it
Sometimes surfaces must come into contact and friction must be MAXIMISED, as when a car is breaking, but more often friction is undesirable and should be minimised.