A friend of mine has irritable bowel syndrome. Both of her daughters have problems with their bowels. Their problems didn't start until after they turned a year old. It could be a lot of different things including a food allergy (some of my allergies as a child affected my stomache and bowels). Don't blame yourself. Try to watch what she is eating to see if it is worse when she eats certain foods. Also, get the miralax it really does help. My friend had to use it for both of her daughters. She used to hide it in her daughter's juice. Both of her daughters had problems with cows milk, also.
Also, try to make sure she is getting plenty of fluid mainly in the form of water. Even if you have to get some Propel flavored water or similar product. The extra fluid can help to make her bowel movements easier to pass.
The most important thing is to try to make her comfortable. When she is trying to pass the movement, try holding her (if she isn't potty trained) so that the poo is not pressing against her and making it harder to get out. Also, rubbing her back always helped with my friend's little girl. (I used to babysit her while her mom was going to school.)
Good luck with you little one.