Latin was required for philosophy, law, rhetoric, and the classics. Greek skewing more towards the sciences, logic and also philosophy. One would be constantly encounter Latin/Greek in their materials and not just as a obtuse code to memorize like how a modern biology student typically views e.g. binomial nomenclature today.
So when viewed through the 21st century lens of English dominance throughout education, it loses the context that makes it much more understandable why and how a young student, especially a precocious one, would pick up those languages specifically in the course of their tutoring, reading, etc. (And not as some kind of genius parlor trick as modern retellings tend to portray it).
Hence that scene in Monty Python's Life of Brian.
Still fun today: https://www.youtube.com/watch?v=Mip30YF1iuo