They have license and royalty agreements with labels now and takedown methods for rights holders who object to things as well as quite capable detection machinery.
I work in this space and there is still a ton of illegal content on YT. As stated earlier, the main difference is that YT complies when infringements are eventually found.