My daughter at this same problem at about the same age as your granddaughter. My doctor told us it was due to an immature colon. He told us to give her an over the counter medicine for constipation twice a day. My mother in law suggested olive oil and it helped. Good luck, she will outgrow it.