The "duplicate" option you see removes
duplicately named files only. There isn't a real capacity for searching the content of files.
EDIT - The above is only partially correct, see Mr_Noodle's answer below; My apologies for the misinformation.I really recommend going with different software for this problem. Finding duplicate text content is relatively straightforward, but still requires an external script. Finding duplicate images is very difficult in script because images can vary in size, brightness, contrast, etc. Most duplicate image applications use a histogram comparison algorithm which is not at all simple to code in AppleScript or shell scripts. PDFs have the same problem as images, unless they are OCR'd.
Because of the complexity, there are generally not free options available, however there might be some inexpensive ones. A friend of mine has recommended
Gemini, although I have no experience with it.
Think of Hazel as a maid - she's only there to keep things organized, but she'll get uncomfortable throwing your stuff away unless you tell her very specifically that it's ok.