When he was 12 years old, Jesus traveled with his parents — Mary and Joseph — to the city of Jerusalem.
They were traveling in a group, going to the city for the Feast of the Passover. This was common in the time for groups of people from the surrounding areas to make the hike on foot to Jerusalem for the spiritual gathering.
At the end of the journey, Mary and Joseph left with the group, assuming that their son was with someone else in the group. It wasn’t until they reached a different city that they realized they left their son behind in a completely different city.