Without this flag, cargo would update the dependencies and the Cargo.lock file if necessary. This could make the build non-deterministic, e.g. if one version of the build updates a dependency to version 1.1 and the next build updates to version 1.2.
Using --locked enforces that dependencies are downloaded exactly as specified in Cargo.lock, making builds deterministic.
If users want to update the dependencies, they can call e.g. cargo check in the root, which updates dependencies