Mobile focused design
This sometimes called the scroll up bar and is a product of mobile-focused design. It is a compromise between having a fixed navigation bar that is always on screen and flowing navigation bar that is only on the top of the page. The fixed navigation bar has the downside of taking up a significant portion of the smaller mobile screen, while the flowing navigation bar has the disadvantage of requiring a lot of scrolling to reach on even rather short pages.
On Desktop, neither of these is as big an issue. A fixed navigation bar takes up a smaller portion of the viewport, and can be smaller due to the higher precision of mouse control. And it takes much less time to scroll back up to the top of the page--both because the page is shorter, requiring less scrolling, and because the user can quickly scroll to the top of the page using the scroll bar and dragging the chevron.
It is also an alternative to the so-called "hamburger menu," which hide navigation elements behind a button the user is expected to press. Hiding the options behind a button makes them less discoverable, and often results in less usage of the options. (Though, as people get used to it, it is better than it used to be.)
By showing the navigation options at the top of the page, and then leveraging a natural action such as scrolling up to show the options again, the navigation options are more discoverable and thus get more use.
Why only on scroll up?
The navigation bar is shown on scroll up for two reasons: the first is that the user who is scrolling up is more likely to no longer be engaging with the page than one scrolling down. The second is that it is natural action: the user saw those navigation options when they opened the page, and thus will naturally begin to scroll back up to the top of the page to try and reach them.
As for those who are scrolling up for other reasons, the idea is that you merely have to scroll up a bit more, and then will naturally start scrolling down again as you keep reading, pushing the navigation bar back off the page.
However, as indicated in the comments here, this often annoys these users. My recommendation to deal with this is twofold. First off, don't make the navigation appear until the user has scrolled up more than a tiny bit. Second, notice how fast the user is scrolling and react differently. A fast scroll or flick on mobile is more likely to be trying to get back to the top of the page, while a slow scroll is more likely to just be adjusting the content.
I also personally recommend not trying to shoehorn mobile design on desktop. There are ways to detect that a user is on desktop (or otherwise doesn't have touch controls) besides checking the viewport width. If the user is on desktop, fall back to a fixed navigation bar, and keep its size reasonable for mouse use.