"Needle in a haystack" is an idiom—a fixed phrase whose figurative meaning (something extremely hard to find) isn't deducible from its literal words.