What Macs do when verifying applications I am asking this out of curiosity. When I download an app by an unidentified developer:

1) What does it mean that the app is by an "unidentified developer"? How is a developer identified?

2) What is the Mac doing when I am opening that app for the first time and I see "Verifying.." (or something similar)?
Apple provides digital 'certificates' to registered developers, who pay $99 per year to register. Any applications signed with those certificates will be 'verified'. 

It's nothing to do with the App Store as such. Registered developers can make certified apps available on their own websites.

Apple can remove the certificate from developers who are found to be shipping malware or being naughty in some other way.

When you first open an application, MacOS checks that the certificate is valid. If the app was made by a developer who is not registered with Apple, then you will get the message that the app is unknown to Apple, and therefore potentially risky. Of course, lots of very good software is written by developers who don't register with Apple.