Added: you might consider using psyllium, a natural plant fiber, in smoothies instead of using Miralax. Blueberries are also a great source of natural fiber. And with dried fruits, be sure to 'stew' them before serving, as they will use the water in the colon to 'rehydrate'. I hope things work out. And do introduce good bacteria (like yogurt) while getting his bowels moving more easily. That will help a lot.
J.,
I hope one of the Grandmas sees this (oh, I can't remember which one)... they had offered a good link in previous questions of this sort.
Riffing off of the general gist of those posts, what was suggested may work in your case: using a 'power' incentive. By this, I mean: think of something your son LOVES. Could be a tv show/ video, video game, legos-- in short, one of his dear, favorite things.
If you feel that this lack of bowel control is more about a power struggle than it is a biological condition, then it's time to put that toy/privilege away for a while. He may ONLY be able to use it/watch it when he stays clean and dry all day. Period. And then, he may only have it for a limited time.
Here's an example. Let's say that your son makes it through the day with no poop accidents. Great. He can watch 15 minutes of the tv show/play video game for 15 minutes. Then, the timer dings and it goes away (preferably out of his sight/reach) until the next time he does well. Same with the toy. He can play with it for 20-30 minutes and then it gets put away. Allow him to 'earn' time with this item, but don't let him stockpile the time too much. This is results-based, too. No 'well, you did try'-- just firm "well, we had poopy pants today, so no, you may not...." if he asks.
I would check in with your pediatrician, just to make sure there isn't any other issue. At five, I'd also check on your interactions and how you emotionally handle pants-messing. If you are giving it a lot of talk and attention, then that definitely gives him a pay-off, even if it's negative.
You can also start having him do all of his changing by himself, as much as possible. This may mean removing the bathmat/carpet on the floor of the bathroom, but having him deal with his own mess: putting the poop in the potty, putting the dirty clothes in a plastic bag, cleaning himself up, and re-dressing himself may be appropriate in this situation. If you do have to help him-- no talking, no anger, no nothing. Flat affect on face (emotionless). Go about the business and do not chat. Do not do this angrily, just calmly and with no emotion.
Kids do give us a run for their money. Regression does happen. When I was a nanny, I had one habitual pant-messer whose mother just decided she was done washing his poopy underwear and would just throw them away. The new underwear came out of her toy budget for him and she let him know. "If I have to buy you new underwear, then we don't have that money for toys. You can choose to stay clean or not." THAT worked for him. Each kid has their own point at which it is just not worth it to them to continue on.
And I also stopped reminding kids to use the potty when I knew that accidents were about power/control. You might consider that, too. "It's up to you to get to the potty on time. I'm done reminding you." I did find that when they had a few unexpected accidents --because I decided that I wasn't going to get into the 'go potty'/'no I don't need to' argument, that was also very helpful. It made the problem *their* problem, not mine. Once they had no one to struggle against, it really took the wind out of their sails in regard to digging their heels in.
I hope something in here might be helpful for you.