I don't necessarily disagree with what was said above, but some things seem to be missing. Here's a different approach to explain why pumping the foil works.
Basically, pumping involves two types of weight shifts: up and down, and forward and backward.
If water would be compressible, then pushing down on the foil would move the foil down in the water. But water is (mostly) non-compressible, so that does not really happen. If the downward pushing force is
behindthe balance point of the foil, the push will do two things: push the foil forward (slightly), and change the orientation so the front wing goes up, and the stab goes down (higher angle of attack). Here's a screenshot from the Kitesurf College pumping tutorial at this point:

Pushing down with the body weight is next followed by a
reduction of the downward force (think about the short moment at a top a jump). Bending the knees to reduce the pressure on the feet enhances the effect, as does pulling in with the arms to put some of the body weight onto the wing):

With less downward force on the foil, it will want to rise up, which is helped by the increased angle of attack and the forward momentum. It will rise only to a certain point before it looses all forward speed, so the next step is to push down with the forward foot to flatten out the board and reduce drag. Putting more weight back onto the board also pushes it down towards the water:

At this point, the board is flat again, and it is partly out of the water. That reduces drag, allowing the board to pick up speed in the next pump cycle.
The coordination of the up-down and forward-backward movements with board height and speed makes this a rather complicated movement. Fortunately for us less coordinated people, some of the coordination skill can be replaced by effort

, especially when we also have a wing in our hands.
Select to expand quote
patronus said..
how does pushing down generate forward momentum. Newton's Law, something must be going backwards i.e. water.
Good question. But if you look at foiling videos without a wing, the foils are almost always started with and external force that creates the momentum: a wave, a bungee cord, someone pulling the foiler, or jumping onto the foil in a dock start. I think I have seen a video where someone started a foil SUP on flat water without any of these, but that looked like an awful lot of work, and there definitely was a lot of water being displaced while getting up to speed. Not sure how many people in the world could do this.