whay would happen if i wrote to non existant eeprom location?

The address "wraps around". The Mega 2560 has 4096 bytes of EEPROM with an address range of 0 (0x0000) through 4095 (0x0FFF). If you try to write to address 4096 (0x1000) the value is actually written to address 0 (0x1000 & 0x0FFF = 0x0000).