It's not what we would think about that today, and as I just ran across the line and remembered that we misinterpret that in our age, I figured it was a good time to do a moment of instruction.
It came in relation to the life of Cynethryth, wife of King Offa of Mercia. History has either regarded her as quite wonderful or quite terrible, with a large dose of "are we talking about the same person?" thrown in for good measure. Late 8th C. She eventually retired to become abbess of the monastery at Cookham after the death of Offa.
It sounds like some combination of a quiet contemplative life, a method of getting out of the way of any poisoning or swordplay around the succession, and a way to become beloved in memory. It was, in fact, the opposite. Monasteries were more like the center of the action. It was, after the court of the monarch itself, where the art, music, literature, science, and general learning were. Because they were hospitals/guesthouses visitors from abroad would often end up there. Religious orders had networks throughout Europe and exchanged information, including practical information like animal husbandry, crop varieties and farming methods, knowledge of fruit trees, vineyards, beekeeping - everything. Many monasteries specialised in elite goods, such as fine woolens, embroidery and lacemaking. Think tapestries, as an example.
Taking herself to a nunnery took her out of consideration of someone trying to move in and marry her in hopes of improving his position for some land. But moving in with a group of people who had education and power of their own was a sign that she would have advisors and allies. She would therefore not be easy to take advantage of. She would still be a force in terms of marrying off her children, siblings, and extending out to other relatives and nobility depending on her skill and authority. She could move freely and be used for negotiations. Think Bene Gesserit in Dune.
I don't mean to imply that this was purely secular and did not involve genuine piety. This of course varied, but much of it was genuine. To "retire" in such a way was to move out of the day-to-day of the running of the country, but thinking about the eternal and thinking about what is long-term is easily confused even in our own day. People want to leave legacies for their church, or their denomination, or a type of charity, or a religious college, just as they might for their town, their nation, or an art gallery. Dividing neatly in those religious legacies between what is eternal and what is for posterity is easy to do in theory, but not quite so in practice. We all have trouble thinking much beyond our grandchildren. (Unless you don't have descendants, in which case "causes" affecting people a thousand years from now seem about the same as those affecting them in only a century.)
Some clearly did set their sites on things eternal. Some had a version of "long-term" that did not extend much beyond the power of their family into the next generation. Most were in between, as would be now.