From what I've been able to tell, many highly gifted persons wound up in religious orders.

Augustinian principles weren't really applied across all of Europe until the late 8th-9th centuries, so until then, clergy could (and did) still marry, etc.

After that, of course, it became a choice that must have led to profound sadness for those from less affluent means... but it would have served as an escape from a life with little meaning and opportunity, at least.

The Medieval period in Europe, at any rate, is a fascinating time for studying what happened to people like that. There seems to have been a surprising degree of social mobility available given the other constraints inherent in the era.

Broad categories which I've found shed interesting light on some perspectives there--

Irish history ca. 700-1000 AD
Hanseatic League and German states during the period
Jewish history on the Iberian peninsula (ca. 600-1400 A.D.)



Schrödinger's cat walks into a bar. And doesn't.