When Mail searches all mailboxes, it searches in the Trash mailbox, but not the Junk mailbox; it doesn’t search encrypted messages, either. To change these options, choose Mail > Preferences, click General, then set the options at the bottom of the pane.
Top Hits aren’t shown when you Create or delete mailboxes in Mail on Mac