It’s been years since I last used a Mac, so might be off on this with the latest versions, but as I remember it: a .dmg isn’t an "installer" in the strictest sense. It’s more like a .zip file, and contains a self-contained app bundle which can be dragged-and-dropped into the Applications folder. A .pkg, however, is an executable and can be used to script deploying parts of an application which can’t be contained in a simple bundle.