GNU Emacs Lisp Reference Manual
If a file's name is `foo', the names of its numbered backup versions are `foo.~v~', for various integers v, like this: `foo.~1~', `foo.~2~', `foo.~3~', ..., `foo.~259~', and so on.
nilneverThe use of numbered backups ultimately leads to a large number of backup versions, which must then be deleted. Emacs can do this automatically or it can ask the user whether to delete them.
If there are backups numbered 1, 2, 3, 5, and 7, and both of these variables have the value 2, then the backups numbered 1 and 2 are kept as old versions and those numbered 5 and 7 are kept as new versions; backup version 3 is excess. The function find-backup-file-name (see Backup Names) is responsible for determining which backup versions to delete, but does not delete them itself.
nil, then saving a file deletes excess backup versions silently. Otherwise, it asks the user whether to delete them.dired-clean-directory). That's the same thing kept-new-versions specifies when you make a new backup file. The default value is 2.