Developers use this process to make raw code or binaries easier for end-users to install.
In the Apple ecosystem, a .pkg is a standard installer format. If you have a binary executable and want to distribute it as a package: bin to pkg