In the Meno a slave-boy solves a problem in geometry merely, Socrates claims, as a result of question and answer aided by a drawing in the sand. No information - knowledge - was imparted to the boy yet at the end of the question and answer session he has geometrical knowledge. He has it but he did not gain or acquire it, for he received no instruction.
Socrates seeks to explain the situation via his idea or doctrine of recollection or anamnesis :
The slave-boy of the Meno, ignorant of geometry, succeeds in
establishing the truth of a fairly difficult theorem with no other aid
than the figures inscribed in the sand at his feet and the assistance
of intelligent questioning. Here is a fact. How is it to be explained? Since
the boy had never been taught, but only questioned, does it not imply that he
had some recollection of a truth seen before he entered human form, a truth
locked and forgotten in the recesses of personal memory? ( R. E. Allen,
'Anamnesis in Plato's "Meno and Phaedo"', The Review of Metaphysics, Vol. 13,
No. 1 (Sep., 1959), pp. 166.)
So the quick answer to the paradox is that we have knowledge, not by gaining it but by recollecting it. Though the theory of Forms is not explicitly present in the Meno there seems to be an assumption that the boy has in a previous existence had acquaintance with the relevant geometrical Forms and this acquaintance is gradually renewed under the promptings of diagrams and questions and answers.
It is a moot point whether Socrates really does not impart information through his questions but one's immediate impression is that the theory of recollection is total fantasy. Yet it marks the site of a significant problem. If, as seems likely, the boy inferred the truth of the theorem and didn't 'recollect' it at all, must he not have had innate resources that enabled him to make the right inferences ?
The current possibility here is nativism, the notion that people have some innate ideas. Mental functions and capacities, perhaps even knowledge of universal grammar, do not appear to be learned. Kant attributed certain categories as intrinsic to the human mind - brought to experience and not derived from it. Could the same be true of certain mental functions and capacities ?
Evolutionary psychology, along with common sense, gives credibility to at least some form(s) of nativism. It appears to answer, or to be en route to answer, how we can have knowledge without gaining it.