Before it was a homework assignment, an essay was a test of weight. The word goes back to a Latin term for putting something on a balance.

Late Latin exagium meant a weighing, a testing on the scales. Merriam-Webster traces it to ex- plus agere, "to drive." In Old French it split into forms such as essai and assai, meaning a trial, an experiment, or an attempt. English borrowed it early. Merriam-Webster dates "essay" to the 14th century, in the now obsolete sense of a trial or test.

The literary meaning came from one man. In 1580 the French writer Michel de Montaigne published the first two books of a collection on all sorts of subjects and called it Essais. A third book followed in 1588, bringing the total to 107 pieces. The title used the ordinary French word for tries or attempts. Wiktionary notes that the sense of a written composition was coined by Montaigne around that time.

English writers soon followed. Francis Bacon was the first to publish essays in English, in 1597. Ben Jonson gave the first recorded use of "essayist" in 1609, and his play Volpone mocks English authors for borrowing "almost as much as from Montaigne." According to Interesting Literature, the form did not really catch on until Samuel Johnson took it up in the 18th century.

The older sense never fully left. "Assay," the testing of metal for quality, is the same word in a different spelling, from the Old French assai. To essay something can still mean to attempt it, and Merriam-Webster keeps a verb sense of "to put to a test."

The weighing idea also survives in a close relative. Latin examen was the tongue of a balance, the pointer on a pair of scales, and later meant an examination. It comes from exigere, the same verb Wiktionary gives behind exagium. So the essay and the exam both started at the scales, which may be some comfort to anyone sitting either one.