In figure-1,a man is walking on ground with an acceleration $a$ forward. Now since the only force in $+x$ direction is the the frictional force,we say that the frictional force is taking the man forward. So friction is in the direction of motion.
In figure-2 A man applies a force $F$ on the box,but again friction is applied against the direction of force applied or motion. How is it that in the first case,when there is no external force,friction is in the direction of motion but in the 2nd case,when there is external force,friction is agaisnt the direction of motion?
From the definition of friction,we know it resists the relative motion of two objects,meaning it can either hinder one object from moving towards other or try to keep both objects moving. So in the first case, when the man was walking, the ground is always at rest,so relative to the ground,the man is walking away from the surface, but since friction can't make the ground move,shouldn't it act against the direction of motion? I find it very contradictory.