What does a .dmg verify?
In most cases, your computer is just doing a checksum, to make sure the Apple Disk Image, .dmg, hasn't been corrupted due to a flakey network connection or hard drive, or from bit-rot, etc. This can let you know about a problem early on, so you don't waste time troubleshooting a bad copy of an app.

Developers also have the ability to codesign .dmg's (thanks @graham-miln), in which case, this signature will also be verified.