In simple words, Composer is a dependency management tool for PHP. If you are familiar with tools such as Maven, npm, or Gradle then the concept of Dependency management is not new to you. For those who don’t know dependency management just a primer here. Suppose you are working on a project and you need to use some libraries. You add them to your project, but if those libraries depend on multiple others then this task becomes a nightmare. This is where a dependency management tool comes handy. You just define what are the libraries your project depends on and this tool will take care of finding all the dependencies, downloading them, and putting them in their proper places.
What composer can do for you?
This is a very conservative list of things that composer does out of the box for you.
Enables you to define a list of libraries along with their versions
Identify the list of versions for all the direct and transitive dependencies
Download these packages from a repository
Update the versions of dependencies with one single command
Enables you to define your own scripts and task executions