Once upon a time, there is a walled city with a large, closed gate bound by magical lock that can only be opened with a magical sword. According to the cityfolk's traditions, anyone who brings the magic sword and unlocked the magical gate is destined to be the lord of the city.
One day, a young hero comes to the city, bringing with him the magical sword he took from the root of the Yggdrasil tree. He tapped the sword lightly on the door, and immediately the magical gate unlocked itself and peered open. The cityfolks cheered, and as per their tradition, they anointed the young hero as the city's lord.
As a city lord, there are many tasks he had to do, one of which is to ensure the security of his people, especially now that the gate is open and bandits and thieves may attempt to enter the city and rob the cityfolks' of their belongings.
To ensure the peaceful days of the cityfolks, the wise lord hired a trusted SU manager to guard the gate; dutifully, the SU manager enters the city, and he closed the gate behind him, and he put a lock that only he can open, then he creates a big door knob for strangers to knock the gate, a small hole on the door where he can peek outside and look at the strangers, then asks the city's lord whether or not to allow strangers in.
In eternity, the wise lord ruled the city for a long time and the cityfolks lives happily ever after.
setuid
doesn't work on Android since version 4.3. So a privileged daemon is run on boot: How Magisk works?