Gatekeeper is the check macOS runs before a downloaded app opens for the first time. It makes sure the app is signed by a developer Apple knows, and has passed Apple’s notarization scan.
When it runs
Gatekeeper checks files that carry the quarantine attribute, which browsers, Mail and messaging apps add to what they download. Apps from the App Store are checked by Apple in other ways.
What you see
If an app passes, macOS asks whether you want to open something downloaded from the internet. If it doesn’t, macOS refuses to open it. In current macOS you can still open it from System Settings > Privacy & Security with Open Anyway.
Why it matters for security
Fake installers often tell you to get around Gatekeeper: drag the app into Terminal, run a command, or click Open Anyway. Treat any instructions like that as a warning sign.