According to my uncle who is a psychiatrist/counselor/psychotherapist....I forget what the right title is...this is common in kids as a coping mechanism for something upsetting. They hide and squeeze in their poop and refuse to go. If they really feel the urge to go, their diet is probably fine, but they can still force themselves not to go. As they get better at it, they can ALWAYS hold it in and never go! This can be trauma from a death or divorce, or "trauma" because they don't like pooping, or anything in between. I'm not suggesting you look for deep dark roots to psychological problems, but be aware in case anything is troubling her and MAKE her go. When you see the signs she's holding it, really, force her to use the potty. Keep it light and cheery, maybe offer rewards, but apply pressure, lock yourself in the bathroom with her and don't let her refuse to poop for days on end. And then if you must, do an enema and explain that's what happens if she won't just go because you don't want her to get sick from not pooping...hopefully it won't get to that point but enemas are harmless and sometimes necessary for people.
If she's still potty training, I'm a big believer in "making them go". I know all the new books say never scold and let the child lead, but kids are like 4 now and still not potty trained! I had to get stern with a couple of my kids when they were well past the ability to be potty trained but still refused. It worked. One hated to poop and I'd sort of "hug" (restrain her) when it was seriously poop time and she wanted to run away. There was crying. There was waiting in the bathroom until the next cycle of urges came around. There were firm directives given. But she got over the psychological hurdle after a few successful poops with celebrations after. Sometimes you gotta push through the trauma rather than avoid it.