Your little grandson is still within the normal range of learning to control his eliminations. The disorder of Encopresis, where a child accidentally or on purpose passes feces into inappropriate places, is not diagnosable until a child is a least four years old. I understand that he is over that age, but is still found in 6 year-olds who are slow learners, or who have anxiety issues.
However, there may be other reasons for this that are not psychological. Actually, the children that usually have a problem with their bowels that lessens their urge to defecate and as a result they cannot control the accidents. This disorder affects about 1 to 2% of kids between 4 and 10, and occurs more often in boys. Most encopresis (about 90%) is due to constipation that has no medical cause (called functional constipation). Their feces is hard, dry, and passes with difficulty and pain, and so they hold their bowel movement (BM) until they have an accident. It is not a behavioral issue or lack of self-control, but because of reactions of parents and others to this problem, the child may develop low self-esteem which may then need psychological intervention. Giving them awards or praise can point attention to a problem they cannot control (as does punishment), and can make matters worse. Instead, a consultation with a doctor (pediatrician) is the best approach. The normal range of defecation goes from twice a day to only 3 or four times a week. If the stool is soft, the child is not constipated. It is the hard balls that indicate constipation. What could cause this? Illness, poor diet, lack of enough fluid intake, fear of toilet training, or lack of privacy (at school, etc.), for example. Sometimes stressful events (divorce, death of a loved one, etc.) can cause chronic constipation. So in the final reckoning, a stressful home-life may contribute to the situation. No matter the cause, when the child holds in the feces it can back up into the colon which removes water, and makes it even drier and harder to pass, and in turn stretches and weakens the colon, which weakens the ability of the nerves to sense the need to have a BM. Furthermore, the colon cannot push the feces out (the job of the rectum). The bloated rectum puts pressure on the sphincter which can no longer hold the feces in, and the softer parts of it leak out. The child does not even realize this is happening because the nerves are not sending signals to the child that he is defecating or leaking. Furthermore, habituation to the odor makes it unnoticeable. The children don't seem to be bothered by this, either because they don't notice, as explained above, or they are in denial because of guilt and shame.
You should have your son seen by a pediatrician who will empty the bowels with enemas, if he is impacted, give him stool softeners or laxatives, and examine him for any damage. There must be a long healing process under care of the doctor.
You or someone else (his mother) should have him sit on the toilet for 10 to 15 minutes, after eating, twice a day, to habituate him, and keep a record of his daily activities. It is essential however, to see his pediatrician. You must be patient, as this will take time to heal.
He might also wet himself with urine. You did not mention it. This difficulty, called enuresis, may be a direct result from holding in his bowels, and in doing so will hold his urine as well, until it can no longer be retained. If there are psychological reasons that contribute to his encopresis (family stress, etc.) then they can likewise contribute to his enuresis. Perhaps jealously of his younger sibling is also a contributing factor, and he should be made to feel that he has not been replaced as the baby. Because of the jealousy he may be unconsciously acting like a baby as well. .
Once these problems start, they become a medical problem, however, and must be tended to by a pediatrician. In the meantime, you must give him love and attention. He probably needs even more than normal because of the embarrassment he may be facing a school. Putting enuresis in perspective, up to 20% of five-year-olds have these symptoms. Encopresis is the main culprit here to be addressed and the statistics don't change must for age six).