Exactly right Swedguy
The "dmg" is used to mount a disk image which usually contains whatever you want to drag to your hard disk (often the Applications folder). Once you've installed what you wanted, you can unmount the disk image and then trash the dmg file.