A package is basically a container for all elements. You can use it to wrap a theme, resources, and blocks into a single package. This is mostly useful if you intend to build a big extension where all the elements are connected together.
By using a package, you make add-ons easier to handle and install. You can also make the installation process a bit more solid by extending the package's installer method to check the requirements.
You can easily recognize a package by looking at its structure, which is shown in the following screenshot:
There are several indications telling you that you're looking at a package and not just a block or theme:
There's a subdirectory called
blocks
ortheme
or any of the directories you can find in the root of your site.The controller is the only PHP file you can find in the root. A block would at least need
edit.php
andadd.php
.