Toddlers are usually embarrassed when they poop their diaper and want privacy as they get older.
Kids under 3 years old are sometimes very content with just pooping and filling their diapers right in front of everyone no matter where they are and are unfazed by pooping in their diapers.
But as a kid gets older and is still in diapers they begin to be aware that they are pooping and they decide they need privacy to fill their diaper with poop.
So the toddler goes behind things or in another room, under a table etc to get out of view of everyone else to poop their diaper.
The toddler may also just not want anyone to know they pooped their diaper because it means that when you find out they pooped the diaper they will need a diaper change.
Some kids and toddlers hate having their diapers changed once they reach 2 years old and beyond.
If a toddler is hiding to poop it could mean they are ready to use the toilet and not wear diapers anymore.
But sometimes it's just because they want privacy when filling their diapers.