Beyond a basic rating system with parental controls, the algorithm does not care if the videos are inappropriate for children. Given enough time with a child, the algorithm will lead them down a rabbit hole where they eventually reach strange videos portraying their favorite fictional characters in vaguely sexualized situations, or videos containing anti-science propaganda and/or promotion of harmful conspiracy theories.
Allowing young children to use YouTube unsupervised is demonstrably a bad idea.