The Partitioning advice page from Gdisk documentation explains why alignment is needed.
The standard sector size for hard disks used to be 512 bytes. This was okay in the beginning, but as disk density increases the small sectors cause various defects, so most manufacturers now use 4096 byte sectors for their "Advanced Format" disks. However, not all operating systems can work with 4096-byte sectors (Windows cannot), so by default such disks use a "512 emulation" (512e) mode, in which a single long sector is presented to the OS as four 512-byte sectors.
On a higher level, most filesystems also allocate disk space in clusters or blocks – very often of 4096 or 8192 bytes in size. If partitioning is done while disk is in 512e mode, older partitioning programs would align partitions to the smaller sector size – or even to cylinder length, even though cylinder addressing is very much obsolete. (Newer tools align to 1 MiB boundaries.)
With 512-byte sectors this is not a problem. A single cluster is written to eight sectors, and if only a few bytes are changed, then only one sector has to be rewritten.
file sys: | ' ' ' ' ' ' ' | ' ' ' ' ' ' ' | ' ' ' ' ' ' ' |
hard disk: | | | | | | | | | | | | | | | | | | | | | | | | | | | | |...
If the disk uses 4096-byte sectors, however, and the partition was cylinder-aligned, it would often end up starting in the middle of a physical 4096-bit sector:
file sys: | ' ' ' ' ' ' ' | ' ' ' ' ' ' ' | ' ' ' ' ' ' ' |
hard disk: | ' ' ' ' ' ' ' | ' ' ' ' ' ' ' | ' ' ' ' ' ' ' | ' ' ' ' ' ' ' |
Disks can only read or write a whole sector at once, so updating a single filesystem cluster would, in this situation, require the disk to read and write twice as much as necessary, resulting in (often serious) performance issues. Even if a filesystem cluster is only written to, the disk still has to read both sectors, and only update the affected part.
The "realignment" program likely just shifts the filesystem to have filesystem clusters aligned with disk sectors.