

Using the API “correctly” is likely a requirement for the view to be counted. Their media extractor circumvents that by intentionally not using their API and instead parsing their website for content. Then it establishes a connection to the stream using an internal API.
If you want a view to count you need to use an official client (or at least one with a legit API key). It not counting is a feature with NewPipe.
(Google probably knows the content is being streamed, but if you could just create synthetic views with a third party project, that would be bad for YouTube stats)
They parse the website for feeds, search, etc. It is a java library and it looks like they are using jsoup to parse the dom.
Using the website and actually establishing a connection to a video are separate things. The search side of things is essentially a headless browser that is just aimlessly looking for videos. As far as YouTube is concerned nothing is played during this process.
When you decide to commit and watch a video, the NewPipe client establishes a connection to the video stream, which doesn’t count for YouTube stats.