The line "Life is like a box of chocolates—you never know what you're gonna get" is spoken by Forrest Gump (Tom Hanks) in the 1994 film Forrest Gump.
Forrest says it to a stranger on a bench in Savannah, Georgia, while offering a chocolate from the box on his lap. It's his mother's wisdom (Sally Field's character), passed on as simple philosophy.
The quote transcended the film—#40 on AFI's "100 Years...100 Movie Quotes," endlessly parodied, referenced, merchandised. It works because it's simultaneously profound and banal: a metaphor so obvious it feels like truth.
Forrest doesn't know it's famous. He's just sharing what Mama said. That's why it lands.