How do they know what it sounded like, if the last native speakers died out 2,000 years ago, when we can’t even keep spoken English the same for 200 years (New Englander vs. Southerner, vs. Valley Girl, vs. etc...)?
The cuneiform script is a phonetic writing system that records the syllable using very evolved and stylized pictures of common items (this is similar to the way hieroglyphic writing came about in Egypt).
Figuring it out involved a lucky find, obviously; Akkadian is an extinct language inside a living language family, and is extinct in the same way really old Old English is extinct; learning Old English wouldn’t be too difficult for modern native English speakers, and the translator of Akkadian made some guesses, tested them, found some sequences which looked like words which had been passed down, and laboriously reconstructed many of the sounds as well as the language itself.
IOW, it wasn’t easy.
As noted above, the non-Akkadian origin was clear from the sound assignments to many of the “pictures” — they didn’t correspond to the Akkadian language, but the writing system had been in use and was teachable, so the Akkadians were stuck with the Sumerian forms. Sumerian was used as a ceremonial language for centuries after the everyday spoken version (as well as the ethnic group) vanished from the Earth.