The work done by a force depends on
force
displacement
angle between force and displacement
The work done by a force depends on force, displacement of the body and angle between force and displacement. Work done is maximum when displacement is in the direction of force.