Hidden-picture puzzles work because our brains naturally organize complicated visual information into familiar patterns. This process is sometimes called perceptual grouping. When several lines resemble a tree, our minds interpret them as one recognizable object instead of examining every possible combination. Although this ability is useful in everyday situations, it can prevent us from discovering unexpected images concealed within ordinary illustrations.
The interesting part is that your eyes may have noticed all the necessary details from the beginning. The problem is how your brain interprets them. Once someone points out the hidden animal, those same branches and curves can suddenly form a recognizable pig. Nothing in the illustration has changed, but your understanding of the image has completely transformed. This sudden moment of recognition is one of the reasons optical illusions remain so popular with people of all ages.