Fascinating story that overlaps with the siege of Troy as depicted in the Iliad. It's really cool to see how the various characters overlap and branch out in the various Greek stories and plays.
Ajax was one of the best Greek fighters in the siege of Troy. However, after the conquest, some award for the best fighter was given to Odysseus, though Ajax felt he deserved it. Basically he lost his mind after that. I guess today it would be chalked up to PTSD.
Ajax slaughters a bunch of cattle, apparently believing the whole time that he is killing his fellow generals that robbed him of the award. It was the work of the Goddess Athena that saved Ajax from going through with the murder of the generals by confusing his senses. He ties some up and carries them to his tent to torture them. Once he realizes what happened and his head clears up a bit, he decides to kill himself. So he runs off to some isolated beach, buries his sward with the point upward, and jump onto it, successfully killing himself.
The end is a debate about the burial of Ajax, which is significant because of how important legacy and the afterlife were to Greeks. Odysseus argues in favor of a heroes burial, which Ajax gets, thus legitimizing Ajax's claim to a hero's legacy. Perhaps the moral of the story is embedded in this debate in that the Greek sentiment towards heroes from battle whose virtues were less useful and whose intensity often disruptive in normal society were given grace and considered heroes despite the fact that the warriors virtues don't translate to the requirements of a peaceful society.