I just wrote about that question over on CSS-Tricks. I go into some detail there, but the argument boils down to this: Even though a basic idea of the Jamstack is that you do as much of your logic as you can during your build process (earlier in the programme lifecycle, if you will), you still have options. Namely:

Recently (like on the Wish you were here site), I tend to do a combination of all of the above.

Again, you can read the full piece on CSS-Tricks.