This writeup is intended as a complement to the one above. Generally, where the first writeup addresses the stated aims of classical historians, this one discusses their other motives. This writeup also defines "history" rather more broadly and sometimes strays to the question of why historians produced the sorts of history they did.
First, because they could. Classical historians wrote in an established genre; they emulated writers they had read and liked. There is a chain of imitation extending in Greek history back to Herodotus and beyond. Cato the Censor, the first to write a Latin history, did it after the Greek model. Later writers looked to earlier ones; some explicitly continued where existing histories left off. The writing of history was, for Greeks or Romans of a certain era, a possibility
This is significant; there have been literate societies which simply produced no history at all.
Like a murderer, a historian needs both motive and opportunity. The opportunity to write history was a rare thing. It depended on the political climate (which was often a compelling reason not to write history) and on the writer's social position: Their nationality, their status (the leisure and education required meant that all historians were aristocrats), their personal involvement in events or their access to (very inaccessible, by our standards) oral or literary sources. In a sense, once the the genre had been formed, history -- like civilization itself -- simply emerged wherever the conditions were right.
Under more central and more oppressive governments, works that could be interpreted as subversive -- and history is naturally political -- were not safe to write. Most of the less attractive reasons listed here apply particularly to Roman historians, especially those writing after the death of Augustus in 14 CE. From this time, writing a disinterested history was increasingly likely -- depending on the ruler of the moment -- to result in exile or death. In Livy, Polybius, Herodotus and Thucydides, we may simply have more dispassionate writers than historians of the later imperial period could afford to be. Some of these reasons also apply best not to the writers of the great monumental histories but to the minor figures in the history of history.
Prestige. Boredom. Love.
"Because" is a reason that should never be underestimated. Once history was established as a respectable literary pursuit, it was written for the same reasons as works of poetry, drama, philosophy and fiction -- to demonstrate learning, to be remembered, to win admirers (especially rich or influential ones), to continue the work of writers they admired, or simply because the writer felt that it was important or that they had something to say or because they liked writing history.
Writing history was also an occupation particularly suitable to respectable public figures in exile or retirement. Xenophon is likely to have written while banished; for the future emperor Claudius, who was initially denied a political career by family members who thought him too embarrassing for public life, the goal may also have been in part to offer evidence that he was not a dribbling idiot after all.
Some ancient figures wrote about their own roles in contemporary events with an eye towards their own legacy or ambitions. Augustus' Res Gestae was intended to glorify himself and his memory. Caesar's war reports enhanced his reputation in Rome -- both as a general and a man of letters -- at times when gathering support from the senate and the people was critical to his plans. Similarly, Cicero's assorted boastings about his role in the defeat of the conspiracy of Catiline (though not intended as "histories" in the formal sense) served to remind the Romans of his services at a time when the state was still nominally a republic and even famous leaders had to go through at least the formality of an election before taking up the power of office.
Ideology. Philosophy. Patriotism.
Many Greek histories of the Roman period are apologias by Romanized Easterners. Polybius and Josephus were outsiders who entered the Roman elite and wrote (essentially) pro-Roman histories addressed to their countrymen. They wrote to advertise the irresistibility of Roman power and to give the Roman elite -- in whose power they were and in whose approval they sought power and status -- proof of their loyalty and gratitude. Plutarch tried, in a series of "parallel lives" in which biographies of Greek statesmen were paired with those of famous Romans, to emphasize the links between the two classical civilizations -- to reconcile Romans to Hellenization from within and the Greeks to rule from Rome.
Polybius and Josephus are also among the historians who wrote partly in support of philosophical ideas. These included arguments for the stoic conception of history, presentations of evidence for the divine preordination of Rome's ascendence, and various attempts to see patterns in history on the grand scale.
Light entertainment was indeed not a goal of the taciturn serious historians, who wrote to edify and educate, but
biographer-historians like Suetonius (and his many continuators) certainly hoped to titillate and amuse, and the author(s) of the maddening and hilarious Historia Augusta -- which may actually have been written as a joke -- also aimed at these sorts of effects.
Though there is some reason to think that some writers may have profited directly from publication, the lack of copyright protection meant that most of the cash that supported those writers not independently wealthy (and most historians were) would come from a powerful patron. Patronage was not as important for historians as it was for poets (poets were often relatively poor, or claimed to be; historians never were), but it did exist. As time went on, the support of a patron becomes visibly more important in the decision to write history.
Writers write, consciously or unconsciously, for their audiences. In the classical world, histories were written for other members of the elite, who were literate and in a position to buy works or attend readings. When the composition of this elite changed, literature changed with it.
From the third century, the top ranks of Roman society were increasingly filled by soldiers who had risen through military merit -- men capable of controlling troops, repelling barbarians, and fighting civil wars, but men without much use for Livy. In earlier times, the military and civil elite had been drawn from the same small pool of senators. Governors, magistrates, army officers and generals had all been given the same intensive rhetorical education (but, like Gilbert and Sullivan's Modern Major General, little formal training in military matters -- which may have played some role in their displacement); they expected one another to have broad intellectual interests. When they were gradually replaced by men who were good at war but had grown up poor in the provinces, the types of history written changed perceptibly to meet their demand.
The result was the epitome -- a "briefing" on the history of the state or simply an executive summary of a wordier historian. In the fourth century, such works became very common. Their purpose was to give the gist of a thousand years of Roman history to a new elite. Men like Sextus Aurelius Victor turned out works that were little more than lists of emperors with short biographical sketches, with recent ones shaded to flatter the patron or current ruler (in Victor's case, Constantius II). The audience had no time for the Livian detail, Tacitean psychoanalysis, Polybian philosophy. The writers may have written simply for the money of their patron.
Men seeking to advance their own careers wrote on recent events. Historians with broader goals sometimes produced works that tried to pull the reader in line with their own beliefs through a judiciously coloured presentation of the more distant past. Tacitus wrote in part to defend and to glorify the senate and to make infamous the names of emperors -- Tiberius and Domitian -- who had executed senators. Cassius Dio was another Greek who wrote (though this was not his principal motivation) in support of the imperial system but also of the senate.
In the later empire, historians were frequently little more than mouthpieces of the regime. Panegyrists and court historians wrote directly for the emperors who supported them. Eusebius, in his panegyrics to and life of Constantine, praised the first Christian emperor in terms verging on the ridiculous. Procopius did the same, with slightly more dignity, for Justinian -- and also produced, in his "Secret History", a libellous attack on his patron and on Theodora that was hardly more balanced. While this sort of thing is most obvious from the fourth century, imperial patronage of historians was well-established much earlier. In a letter of 166 CE, Lucius Verus (then co-emperor with Marcus Aurelius) wrote to his friend Marcus Cornelius Fronto, who was planning a history of the recent campaign against Parthia:
I am ready to agree to any suggestions as long as my achievements are highlighted by you. Naturally you will not omit my speeches to the senate and addresses to the army. I shall also send you the text of my negotiations with the enemy. They will be a great help to you... You should spend a lot of time on the causes and early stages of the war, and particularly on the poor progress in my absence. You should come slowly to my role. Moreover, I think that it is essential to make clear how much the Parthians had the upper hand before my arrival, so that the extent of my achievements may be highlighted. (Fronto, Ad Verum Imp. 3.2)
With the sole exception of Ammianus Marcellinus, who deserves to be bracketed with thoughtful historians like Livy and Thucydides, history was by the fourth century a weapon to be used without scruple in arguments about higher truths. This is clearest in the writings of Christians who wanted to complete the demolition of earlier religions and in those of pagans reacting against Christianity. Lactantius, in De Mortibus Persecutorum ("on the deaths of the persecutors") tried to demonstrate that those who had attacked the Christians had suffered divine retribution; Eunapius, Libanius, and many others used it simply to ridicule the Christians.
For later writers, history -- like philosophy and art and the rest of the world -- did not exist outside of a Christian context. Those pagan writers who survived into the fifth and sixth centuries did little better. History dwindled to almost nothing in the West, ending up in the custodianship of the Church, and in the East became increasingly a tool of the church and the state.