When you approve of something, you are — etymologically — declaring it has passed a test. The word comes from Latin approbāre, composed of ad- ('to') and probāre ('to test, to prove good'), from probus meaning 'good, honest, virtuous'.
In Roman legal proceedings, approbāre was a formal act. A magistrate approved a document by examining it and certifying its validity. The approval carried weight because it followed scrutiny. The modern sense — a casual nod of agreement — would have puzzled a Roman jurist.
The root probus generated a remarkable family of English words. Prove descends from the same verb: to prove something is to test it. Probe is the instrument of testing. Probation is the testing period. Probable describes what is likely to pass the test. Even reprove belongs — to reprove someone is to test their conduct and find it wanting.
Old French inherited the word as aprover, and Middle English adopted it in the 14th century. The legal sense dominated early usage: courts approved wills, councils approved measures. Only gradually did the word soften into everyday endorsement.
The Spanish cognate aprobar still carries the dual meaning — to approve and to pass an exam — preserving the link between approval and testing that English has largely forgotten.