Every examination is, at its etymological core, a weighing. The word comes from Latin exāmināre, meaning 'to weigh' or 'to test', from exāmen — the tongue of a balance, the pointer that indicates the result. Before it meant a school test, exāmen meant a physical instrument of measurement.
The deeper root is exigere: ex- ('out') + agere ('to drive'). To examine was to drive something out onto the scales, to force a measurement. The same verb exigere produced exact (weighed and found precise), exigent (demanding, pressing), and essay (from Latin exagium, 'a weighing' — an essay is an attempt to weigh an idea).
The root agere itself, from Proto-Indo-European *h₂eǵ- ('to drive'), is one of the most productive in English. It gave us act, agent, agile, agenda, and navigate (navis + agere, 'to drive a ship').
The testing sense of examine was well established by the time the word reached English via Old French in the 14th century. Universities adopted it for formal assessments — the shortened form exam appeared in the 18th century as student slang. The medical sense ('examine a patient') preserves the original meaning most faithfully: a doctor examines by weighing symptoms against possibilities.