In the weeks after a birth, a toddler's days are reorganised around someone else. Parents are tired, routines shift, and a lot of the attention they used to get now goes to the baby. Toddlers notice all of it, and they do not have the words to say 'I feel pushed out'.
What they do have is their body. Asking for a diaper is a way of being small again, like the baby. Holding poop is a way of keeping control of something when everything else has changed. Accidents bring an adult running. None of this is calculated; it is a toddler using what works.
Potty training that was recently finished is the most fragile. A toddler who was just getting confident on the toilet may decide that the diaper is simpler, especially if the baby's diaper changes are a place where parents are gentle and attentive.
Most regressions settle as the new routine becomes the normal one. The risk is when holding leads to a hard poop that hurts, because pain can keep the holding going long after the baby stops being new. That is why soft poop and low pressure matter even when the cause is emotional.