Why do some apps need to be installed using root, and others do not?

Basically, the title. I've used revanced to patch YouTube and Reddit's app. YouTube only seems to work if I install as root. Reddit's app only seems to work if I don't use root. Wondering why that is.