I would first talk to a doctor to see if there is any medical issue that causes her to not be able to control or to sense her bms like she should be able to. Then I'd try a chart with stickers for successful uses of the potty with a private date with mommy as a reward after earning so many stickers. Either there is a medical reason, or a psychological one. The psychological reasons fall into three categories: 1) She has some aversion to having a bm and so tries to avoid it until it's too late or 2) She is trying to exhert some control over you or whoever is with her during the day or 3) She is seeking negative attention. In any case, a reward system could distract her from these reasons long enough to set a habit. If it is #2, you could try to give her control over something else as a reward for using the potty. My son, brought home from a Russian orphanage about a year ago, completely regressed and was back in diapers for months after we got home. He was also 4 when he finally started using the toilet again just about a month ago. It was soooo frustrating! 4 yr old poop is just nastier than baby poop. I feel your pain. I finally had to just tell him that he was too big for diapers and then wouldn't let him sit on any of the furniture (except the kitchen chairs) until he'd gone 3 full days with no accidents. He sat on the floor for like a week. Sounds cruel, I know, but it didn't involve yelling, spanking, anger of any sort. It was just logical that he couldn't sit on my furniture if I couldn't trust him not to soil it. And amazingly, after nine months of stress, pressure, patience, and being at my wits end, that was all it took.
Best wishes.