Why doesn't installing GRUB on MBR destroy the partition table?
Solution 1:
The software reads the original sector; updates it in memory; then writes out the updated sector.
On Linux, this is actually done by the OS itself, so GRUB doesn't need to worry about sectors – it can just issue a 440-byte write, and the OS will read/modify/write the whole 512-byte sector accordingly. (The job of an OS is to abstract away the inconvenient hardware details.) But if the OS didn't do this, then GRUB could still do the same read/modify/write thing on its own.
This "read/modify/write" pattern is not limited to just the MBR – it's also how you're able to change individual bytes within a file, even though they're also stored in disk sectors. The OS will read the corresponding sector from disk, update it with your changes, then write the new sector back.