Why is the time delay of directly requesting the api and js requesting the api very different?

Question

I wonder Why the time delay is different between directly requesting the api and js requesting the api.
The former is about half the time of the latter.

screenshot

  1. request in js, as a xhr-type
    enter image description here

  2. request directly by browser, as a document-type
    enter image description here

  3. then time estimated above is about TTFB(Time To First Byte)
    enter image description here