Why does installing a package create a directory on my desktop? When I install a package, it creates a directory with the name of the package on my desktop. In Finder it looks like a new external drive:



Why is that? Should I always remove those drives after installation? Or did I do something wrong and this should not show up?
This is normal.  These programs have been downloaded as virtual disk or .dmg files.

For example Mendeley Desktop is a program supplied as Mendeley-Desktop-1.19.4-OSX-Universal.dmg file.  When you open the downloaded file by default you will see it appear on your desktop and as a removable drive in Finder.



Once you have dragged the application to Applications you can eject the virtual disk in Finder and then delete the downloaded .dmg file.

Note some programs - MS Office for example - are supplied as packages (files ending in .pkg) rather than .dmg files.  When you run this type the program is installed without mounting a virtual drive and macOS will automatically prompt you to delete the installer file once done.