There are multiple ways for Google to know that NewPipe is installed in a device. Play Protect scanning is one way mentioned in the OP’s github link.
Another method I can think is, when I download a mp3 file using newpipe, it adds the text “NewPipe” for the Album mp3 tag. and PlayMusic automatically uploads any new mp3 file downloaded to your device.