A package manager is a collection of distributed software. I like to think of it as a giant repository of plugins — code libraries that don't come native to an environment or programming language, but provide some functionality on top of it.
But packages can be much more complex. For example, a server-side language may have packages that handle authenticating users for an application.
One benefit of using well-maintained and distributed packages is that they are supported and tested by the community. That means you can grab solid, stable code that just works, and write less code for your project.
The headless CMS is a core tenet of the Jamstack approach, a gamechanging approach to building modern websites. Here is an intro to the headless CMS approach.