If you publish an AWS Lambda function, you will see that the system creates an updated version each time the function is published. An updated version is a copy of an unpublished function. In order to ensure consistency for users, the code and most settings are locked when a version is published.
If the code in the unpublished version is the same as in the previously published version, Lambda doesn't create a new version. Creating an updated version requires deploying code changes in $LATEST.