Once a child starts to "withhold" their poop, this is not a good sign. This is anxiety. They WILL get constipated... and this makes it worse, because it hurts, gets harder to come out, gets impacted internally, and so because it hurts, they will withhold pooping again. A vicious cycle.
This is per our Pediatric Gastroenterologist Specialist, which we had to see because my daughter went through that. He said, Toddlers COMMONLY go through this, once they are expected to potty train. Pooping... takes longer to master, in a toilet, and for the emotional comfort with it. He said, NOT to force it or make it an issue nor to scold/punish for it. This will only make the constipation worse. Once on a vicious cycle of withholding poop and becoming "constipated"... it is then a biological AND emotional based issue. AND, at least for my Daughter, he said that is can take a minimum of 3 months... to overcome AND for the poop to become of normal consistency etc. We had to give my daughter prescribed things to alleviate her constipation and for her to stop "withholding" her poop, and to overcome the anxiety. We did not "force" my daughter's toilet training nor pooping... but the process can create anxiety in the child, regardless.
If, constipation continues and does not resolve, it can even develop into "encopresis." (look it up online).
One thing the Pediatric Gastroenterologist does NOT recommend, is suppositories. This is habit forming and does NOT solve the problem nor the emotion based withholding.
You need to see the Doctor. The more she withholds it, the worse it will get.
All the best,
Susan