It depends. It is possible to have more than one program loaded (like the Bootloader and a Sketch).
If the Bootloader was used to load the existing program and the Bootloader is used to load the new program, the existing program is overwritten (this is the most common case).