If you study the animation below, you will notice that the work done by a constant force F, acting through a distance Dx can be interpreted as the area under the force vs. position graph for that motion.
Now, work is not always force times distance, but it turns out that the work done by any force (or at least the component of the force in the direction of motion) will always equal the area under the force vs. position graph.