When an army goes to war, you need the soldiers to obey the commands of the general even if they know they are walking into certain death.
When the soldiers landed on the D-Day beaches in Normandy, the ones on the front lines were almost certain to die. They were meant to be cannon fodder, so that those behind them could make more progress and overwhelm the German posts. If those in front did not rush into near-certain death, there was no chance for those behind them.
In the Roman army, maintaining that discipline was important. There had to be no room for mutiny, cowardice, desertion or insubordination. An army cohort used to number about 480 soldiers. If the cohort engaged in any of the above capital offences they had to be punished. But punishing all of the soldiers would mean there would not be any soldiers left!
So the Romans devised a plan to punish the soldiers.
The entire cohort would be divided into groups of 10 soldiers by the draw of straws. The one who drew the shortest straw would be executed by the other 9, often through stoning, clubbing or stabbing.
Decimatio in Latin means ten. Since the soldiers were divided into groups of 10, and the tenth soldier was picked for punishment, this form of punishment came to be known as decimation.
The earliest reference to this practice goes back to 471 BC.
For a long time, Decimate meant to reduce by a tenth. Then, as the Roman Empire itself got decimated again and again, the word made its way to English.
As this word jumped across to English, its meaning got completely altered to imply complete destruction.