Some background for anyone who doesn’t know the context here - this is from an imaginary dialogue between the Athenians and the people of Melos, and this isn’t Thucydides himself saying this from his own perspective.
The Melians have been neutrals and do not wish to pay tribute to the Athenians like many of their other island neighbors. The Athenians say fuck you, pay me, or we kill all of you. The Melians try to reason their way out of it, but they cannot offer the Athenians anything other than an appeal to their morality. The Melians refuse to surrender. The Athenians kill all of the men and sell the women and children into slavery. End of Book V.
Earlier (13 years or so), Thucydides has Pericles remind the Athenians that “the empire you hold is a tyranny,” and warns them that it may have been wrong to take it, but it would be dangerous to let it go because obviously there are going to be a lot of people out there who would have a motive to raze Athens. What the Athenians do to Melos (and Scione, and nearly did to Mytilene) is supposed to be what’s going to happen to Athens at the end of the war, and is what the Athenians feared when they finally lost.
Instead (Thucydides doesn’t get this far), Sparta merely demolishes the Long Walls, letting Athens survive as a city - because they needed Athens, however weakened, to remain as a buffer between them and the Thebans, who were in favor of giving Athens the Melian treatment.