Regular sails actually work similarly to a wing, in that pressure differentials on either side create a force we call lift on a plane, rather than simply being "pushed from the back" by directly catching the wind. That's why a sailboat can go in almost any direction regardless of which direction the wind is blowing.