It uses the macdeployqt tool which copies Qt and its plugins into the App Bundle.
macdeployqt also tells the main application to link against the libs contained in the bundle, instead of the system libs.
This does not happen to the libmarblewidget and the Marble plugins, so it has to be done by the script.
The script also sets a background Image for the dmg. (Place it at ~/Desktop/marble-dmg-background.png or change the path in the script)