It's really simple
In package.json there an dependencies object which contains all the dependencies with it's version number.you install it like,
npm install <packagename>
there is also an object called dev Dependencies which includes all the packages that are used in development phase not production or testing phase.you install these packages like,
npm install <packagename> --save-dev
dev dependencies may be needed at some point during the development phase, but not during execution.
examples webpack, rollup these are bundlers used to compile your app but they are not the part of your app.
I hope this answer will solve your doubts.Happy to help.keep growing.