Nighttime bladder and bowel control development is somehow slow. So even when they keep dry during the day, it can take a while before they notice in their sleep that they need to use the potty, and it only makes sense to keep using diapers at night for a while.