G# and Ab are not the same sound.
They are the same pitch in well-tempered tuning, but that’s a small part of the picture. They are not even the same pitch if you’re singing or playing a fretless instrument, like a violin.
The reason is that the pitch changes slightly based on harmonic context, and the notation communicates the context.
G# typically conveys a tension in an ascending movement (assuming the key is Am or one of its neighbors). Ab can convey tension in a descending movement.