WordPress does not overwrite files that have the same name. Instead, it appends a number or random value at the end of it to make it unique: filename.png will be turned to filename-1.png
If you do not want that, this plugin is for you. Instead of adding it as a separate file, it will replace the file if it is within the same folder. Here’s a list of all the available features:
PLEASE NOTE: After a file is replaced, the old file is still visible within the media window. Once you refresh, it is gone.