Usually nothing of note, but it simply "installs what you tell it to". npm installs to ./node_modules
relative to where you run it, and installs whatever version is specified, or "the latest one" if you don't specify any version. If there is already a dependency dir for what you're installing, that's deleted, and then the thing you're telling npm to install is put in its place.
Does that cause problems? Only if you let it. If it deletes and reinstalls, the net effect is no change. If it deletes a specific version and replaces it with a different version, then that might be a problem, but a problem of your own making: this is what the package.json dependencies
list is for, so that npm install
installs exactly what you need it to.