Children are more apt to confess misdeeds if they think parents will react positively
Even if they believe they could be punished, older kids are more likely than younger children to view confessing to a misdeed as the right thing to do. Ref. Source 3s.
I was an avid liar growing up. I would lie about stupid things that didn't matter just to get away with it. Overall, I would say I was a good kid, who didn't really get in trouble (Even if my transgressions were known), but for whatever reason, I enjoyed lying to my parents. I think it was a dynamic that I was raised with. My parents divorced when I was about 6 months old. And remarried when I was about 4-5 years old. They all the time told me to hide something from someone and my dad told me many times that it is often better to seek forgiveness than ask permission. I thought it was normal to just hide random facts and enjoyed seeing what I could hide and what they would discover. Because much of it was stupid stuff that didn't really have any consequences, I rarely got in trouble for lying, my parents just assumed I was mixed up. When I went off to college was when I found out how big of a problem and how out of the norm it was. I am now happily married and don't hide things from nor lie to my wife, but she has had to put up with a lot of frustrating shenanigans when we were dating and she still has some trust issues from how dishonest I used to be.
Getting children to tell the truth can be quite frustrating, even for those with very understanding parents. Many have an instinctive fear of getting in trouble, even if they fully understand they will just get into more trouble for lying and they are caught.
More, lying is all around us. In movies, on tv, on the internet, and at school. Really I am somewhat at a lost how one might convince a child to tell the truth, especillay if they have done something that would upset their parents even if they are not unreasonable in such.