This is a practice mentioned in A Song of Ice and Fire and I was curious if it has historical precedent.
Was this something that existed during medieval times (or before/after)? If so, what was the general reasoning behind the practice?
This was a relatively common practice in Sengoku Japan, although it was often a sort of "hostage" situation, meaning that should the clans feud, the fate of the hostage would be at stake. Thus, this would usually deter the clans from conflicting with one another.
As a historical example, at one point, Matsudaira Takechiyo, a member of the Matsudaira family, was sent as a hostage to the Oda clan, where among his various acquaintances was Oda Nobunaga, at the time the to-be heir of the Oda clan. He was essentially secluded away, as a hostage, but he and Nobunaga developed a friendly relationship.
Later, Matsudaira Takechiyo changed his name to Tokugawa Ieyasu, and became a close ally of Nobunaga, eventually succeeding him after his death and establishing the Tokugawa Shogunate.