Each time you confirm a message as junk or not junk, the junk mail filter improves so Mail can better identify junk mail.
The default settings catch most of the junk mail you receive, but you can customize the filter.
Go to the Mail app Use the Touch Bar on Mac