This is handled by the certificate the application is signed with. Getting your code signed through a credible certificate authority is almost the only way to distribute your software and have people trust your code.
Here's some good documentation how code signing works, how it verifies authenticity and more:
You could self sign, however, it will only apply to the local machine that has it installed.
DigiCert is what our company uses for our application certificates: