how does the wordpress rest API work

If i was to use the REST API to query posts, on the a particular
archive page, does it query all posts in the database, or does it be
specific to that page’s inbuilt query?

The REST API is for getting raw data for external applications or via AJAX with JavaScript. It’s not intended to be used for building archive pages or anything like that. The API only returns data according to the parameters you set; it doesn’t know anything about a page’s existing query.

another question, which may sound complex, is there a feature within
the API where a person can find taxonomy terms associated with posts
for a particular archive page?

No.

You can get a list of posts in a particular taxonomy term by specifying that term in the API request, so if the archive page was for a particular term you could get posts for that term using the API, but that’s all.

If you want to, for example, get all tags used by all posts on the current category archive, then the REST API isn’t going to help with that.


Based on your questions I’m inferring that you want to implement some kind of faceted search or filtering. The built in REST API endpoints do not have any built-in behaviour to help with this.