They solve different problems. WordPress is a full stack solution that's great for blogs and simple websites. The downside is that it's a lot of maintenance (requiring a LEMP stack) and not very portable. You have to copy over everything from the code to the database to the files to things like htaccess and nginx config. Hosts Like Pantheon and wpengine make that easier, but you're still bogged down by overhead. Scaling is really hard if mere caching doesn't work because you have to deal with Mysql replication and slaving. And what's really annoying about this setup is that you HAVE to deal with the whole stack. If the content writers want to preview their changes, you have to a clone them a staging environment. That means DB merges or overrides. And if you're simultaneously making other changes to the production DB, good luck reconciling the two.
Jamstacks really shine when you can decouple the frontend from the backend(s), because then you have an easily replicable single repo with nothing but code. You can deploy it to any Jamstack host with a push and they handle all of the scaling and https and caching concerns. And the backend teams, whether an in house endpoint or content writers working on a hosted headless CMS, never have to care about the stack.
A middle ground that's interesting to explore is using WordPress with Advanced Custom Forms as a backend plus a Jamstack frontend. ACF is still quite a bit more powerful than any of the headless CMS solutions I've tried, but it does mean you still have to maintain a LEMP stack, which is a headache in and of itself.