It happened very, very, very rarely. The most famous example was that of Charles V of Spain, Burgundy, the Netherlands, Austria, and Holy Roman Emperor, who abdicated his various titles between 1555 and 1556, in part because of his age and health, and in part because he realized that, by gathering too much lands and titles in one person, he’d become a threat to all of Europe and hence the various European powers would keep allying against him lest they be swallowed up by the Hapsborg.
As for why, I think it was because he thought it was a bad thing to have adult male heirs banging around the place not getting to do anything useful during their prime.