npm installs and manages packages; npx runs a package's executable, fetching it for that one run if it is not installed.
npm install eslint --save-dev # adds the package to the project
npx eslint src # runs the project's local eslint
npx create-next-app@latest # runs a one-off tool without installing it globallynpx first looks for the command in the project's node_modules/.bin, then on your PATH, and only then downloads the package into a cache. That makes it the right choice for scaffolding tools and for running the exact version a project depends on.
