If you use Magisk, which is one of the most common ways to root nowadays, it not only roots, but allows custom software to be installed "systemlessly". This means in most cases, SafetyNet won't be able to detect a rooted phone.
Just like with jailbreaking, smart people will always find a way around these barriers Apple and Google put up
Just like with jailbreaking, smart people will always find a way around these barriers Apple and Google put up