We do not now necessarily impute scholarship to the person whom we call a clerk, but such was the original significance of the word and is still assumed to be the case in many instances of its use.
The term was originally a slurred pronunciation of cleric, and it designated a clergyman, one who was ordained to the ministry of the Christian Church.
Scholarship, in medieval times, was rarely found outside of the religious orders, so the cleric or clergy was called upon for most of the secretarial work of the period.
Gradually, as learning became more general, the early significance faded, except in certain long-established legal and clerical titles.