The origin of the expression is unclear. One interesting interpretation connects it to the ancient myth of the foundation of the city of Rome. The legend tells the story of two orphan twins, Romolo and Remo, rescued and suckled by a female wolf. Supposedly, the wolf cared for the toddlers in a cave, in the wild land where later on an adult Romolo laid the foundations of the city of Rome, becoming its founder and first king.
According to this interpretation, the expression “in bocca al lupo!” is meant to be a wish for protection, prosperity and the potential for great things by being safe in the mouth of the wolf.