Children up to the age of 4 or 5 live in a world where fantasy and fact freely mix. They love hearing stories and making them up. For pre-schoolers, wishing something were true can make it true. In that respect, lying is a normal part of the developmental process.
I recall an incident where a 3-year-old released the handbrake in the car and it rolled into a duck pond. Her explanation as to how the handbrake came to be released was very simple - a naughty duck did it. She picked it was naughty, but she wasn’t yet ready to accept that the naughty action was hers.
Similarly, the youngster with crumbs down his front who denies having been anywhere near the biscuit container.
Older children are more consciously self-serving. Generally, they want to avoid being held responsible for something or to get out of doing something. They’ve developed a conscience and an understanding of the difference between truth and untruth but not necessarily a full appreciation of the broader impact of lying. They’re usually trying it on.
Sometimes the fantasy aspect continues and the lies become boastful ways of gaining attention or respect or protecting a fragile self-esteem.
Unchecked, these sorts of lies are carried forward into adolescence where they’re joined by other forms of lying that can serve a wider range of purposes.
Teenagers clearly understand what lying is. They can become quite skilled at it, particularly when they want to avoid taking responsibility, blame or punishment, or to get something they believe they mightn’t get by being truthful.
By this age, they’ve also come to realise that it can be acceptable to lie to avoid hurting someone’s feelings or to protect someone, though not necessarily for the best of reasons. They may lie, too, to protect their privacy, independence or to avoid embarrassment.
Persistent lying arises from the little lies that worked successfully in the past and which then can become habitual and compulsive. We’re into real deceit at this point, which is something not as easy to deal with - certain United States and British politicians providing ample proof of this and most of the other points above.