The magnifying glass has become the standard icon for search. Another common visual metaphor for search is a pair of binoculars.
The magnifying glass has become more popular, perhaps because it is possible to depict with a minimal amount of graphic elements and therefore it is more legible even in small sizes. The magnifying glass was apparently invented by Keith Ohlfs and first appeared in the NeXT Workspace manager around 1989.
NeXT Workspace manager 1989.