Imagine that you are pushing a box on the horizontal surface. It is clear that you are trying to produce the motion of the box relative to the surface. If there is no friction between surface and bottom surface of box in contact, you will not require any force to move the box. In other words , in the absence of friction you do not need any force to have motion of the box relative to surface. Now, it is a matter of common experience that more the roughness of the surface( or more the friction) we need more force to move the box as friction opposes the motion of the box relative to surface.
why friction opposes relative motion
because it moves in opposite direction of motion daily example are when we drive car and we applied brake to stop the car.The car stop we will think that why the car stop.When we applied brake to the car friction acts in opposite direction of motion like if the car move in east direction the friction will act in west direction.We can say that friction act in opposite direction hence,it always opposes relative motion.