DMG files are proprietary disk image files used for software distribution in Mac OS. Providiing both password protection and bzip2-like compression, these files are perfect packaging medium.
Usually DMG files are opened automatically when you click them in Finder. They appear as a folder with files, but actually Finder mounts each DMG file as a separate filesystem and then shows you its contents. If you're observant enough, you'll see that in the left side panell of Finder you have all the active DMG filesystems listed and ready to be ejected once you finish copying the files or installing new software.
Sometimes you may want to download and mount DMG file using Mac OS command line, and in this post I'll show you how to do it