What is a DMG File (And How Do I Use One)?

DMG files are containers for apps in macOS. You open them, drag the app to your Applications folder, and then eject them, saving you the hassle of the dreaded “Install Wizard” of most Windows apps. So if all they are is a folder for an app, why do we use them instead of just downloading the app itself?