The word is really about salt. The famous story attached to it, of Roman legionaries collecting their wages in salt, has no ancient evidence behind it.
The Latin salarium was a regular allowance paid to soldiers and officials. It comes from the adjective salarius, "of salt," and ultimately from sal, "salt." Wikipedia sums up the state of knowledge bluntly: the word pertains to salt, "but the exact connection is not known."
The key ancient text is a single line in Pliny the Elder's Natural History, from the first century CE. The classicist Peter Gainsford translates it roughly as: salt "is also related to magistracies and duty abroad, and that's where we get the word 'salaries'." Pliny links the word to salt. He does not say anyone was paid in it.
So where did the salt-wages story come from? Gainsford traces it to Latin dictionaries, not Roman writers. In 1771 the Facciolati-Forcellini Latin lexicon guessed that salarium was a salt allowance once given to soldiers. Later dictionaries recast the guess as "salt money," a gloss Lewis and Short still printed in 1879. Meanwhile, by around the 1860s, popular writers had hardened it into a claim that soldiers were literally paid in salt.
Gainsford is blunt about that claim: "There isn't the tiniest scrap of evidence to suggest this." His own suggestion is that the name worked as a figure of speech. He compares the Greek opsōnion, literally "money for relish." Salarium may likewise have meant the money for everything beyond the basic grain ration.
The word reached English through French. Anglo-French salarie and Old French salaire meant wages or reward, and English had "salary" by the late 13th century. In the 19th century it narrowed to fixed pay agreed in advance and paid at regular intervals. That is the sense that still separates a salaried job from an hourly one.
The phrase "worth one's salt," meaning capable or efficient, is often offered as proof of the Roman story. Etymonline dates it to only 1830, far too late to be a Roman memory.
What survives, then, is a real link and a missing explanation. Salary and salt share a Latin root, and nobody knows exactly why.