It comes from Thucydides’ History of the Peloponnesian War (2.43.4), in the Funeral Oration he gives to the Athenian leader Pericles. The popular line is a paraphrase: Richard Crawley’s translation reads “judging happiness to be the fruit of freedom and freedom of valour”. The word “secret” is not in the Greek.
What it means
You cannot be happy without being free, and you cannot stay free without the courage to defend that freedom. In the speech it is a call to the living to follow the example of the Athenians who died in the war’s first year.
Where it comes from
The words belong to a speech. Thucydides reports the oration Pericles gave at the public funeral for Athens’ war dead, and, as with all speeches in his History, the wording is Thucydides’ own. The Greek is very compressed — literally, “having judged happiness freedom, freedom courage” — so every translator fills in the links differently. Richard Crawley: “These take as your model and, judging happiness to be the fruit of freedom and freedom of valour, never decline the dangers of war.”
The popular version keeps the idea but drops the rest of the sentence, which is an appeal not to shrink from the dangers of war. The University of Bristol’s Thucydides project notes that it is not clear where the word “secret” came from; it does not appear in the Greek or in the classic translations.