This is a subject I ran into in an online forum, so I thought I'd post my reply here:
It's one thing if it the friends are, say, teens who shoplift. That's not something "all kids" (or at least a lot of kids) do. With younger kids (especially kids around 5/6, I think, but maybe even with some a little older in some cases), it's a different thing.
Young kids can be raised to know what's right and wrong, and they can very much want to do what's right. What they run into can be temptation that's more than they're emotionally ready to be able to resist. They know "in their head" that stealing is wrong. (That's why a lot of them are very clever at making sure nobody ever discovers that they've taken something.) It's not something that absolutely "every" kid does as a little kid, but it's something a whole lot of kids do (and even if for some, it's nothing more than a candy bar once or twice). There's something awfully appealing about something like a candy-bar rack, and resisting that urge (especially if kids know their parent won't buy it) can be hard for - like - a five-year-old. Their brains are developed enough for them to be able to think up "deceit" and a "plan" and a "cover-up", but emotionally they're not always able to resist the urge to take what they want.
When he was still with ABC News, John Stossel did a thing on what's called "frustration tolerance point", and it was found that the more kids did without something, the more likely it would be that they'd hit their frustration toleration point and be unable to resist temptation.
It's not just stuff like candy, though. Little kids may see something that appeals to them, like shiny coins, other "shiny objects". Kids who have plenty of the kind of thing that catches their eye aren't as likely to have that frustration tolerance point as kids who never really have the kind of thing they find appealing for reason or another.
It gets the best of them. They take something here or there. Some take more than one thing here or there. They feel horrible about what they did (if they're normal, rather than if they're just "little sociopaths", which most little kids are not). Eventually (and in generally not in all that many years at all), most outgrow even having the urge to steal at all and/or they at least become emotionally mature enough to be able to control the urge to steal if it happens they get such an urge. Most just outgrown even seeing (if only for a moment) stealing as an option, no matter how much they want something.
Young children of the "best parents in the world" have been known to "lift" something at one time or another, or even over a period of time when they were in that "around five" (or so) age range.
Here's the take of The American Academy of Child and Adolescent Psychiatry on the matter: