Bequeathing

The Bequeathing is a ceremony in which a Keyblade wielder chooses someone to inherit a Keyblade. The Bequeathing causes a Keyblade to choose the person being Bequeathed, and it only works if the person performing the Bequeathing is on the level of a Keyblade Master and if the person being Bequeathed has a strong enough heart to be able to wield a Keyblade.

Procedure
A Bequeathing ceremony may be either intentional or accidental. To pass down the Keyblade intentionally, a Keyblade master must choose a successor. All the master must do is test the strength of the one they have chosen by allowing him or her to hold their Keyblade. The Keyblade is accidentally inherited when one of a strong heart and will makes contact with it.

Kingdom Hearts Birth by Sleep
Some time before the Mark of Mastery exam, when Terra, Ventus, and Aqua were still training together, Ventus felt down about losing to Terra in a mock battle. Terra cheered him up, performing a mock Bequeathing, in which he recited the mantra and passed his Wooden Keyblade on to Ventus.

The Bequeathing is unintentionally performed when Aqua visits Radiant Garden and comes across a young Kairi, who was being attacked by a swarm of Floods. Kairi runs to hide behind Aqua and touches the Keyblade, which causes her to become an inheritor.

Aqua also had the intention of performing the ritual with Sora when she met him in Destiny Islands, but she noticed that Terra had already made it with Riku. Not wanting them to fight like she and Terra would, she refrained, although Sora and Riku would inevitably clash with each other several times ten years later.

The Bequeathing is intentionally and correctly performed by Terra when he meets a young Riku on the Destiny Islands. Seeing himself through the boy, someone who would do anything to protect his friends, Terra proceeds to select Riku as an inheritor. Many years later, this showed that Sora was not originally the Kingdom Key's original chosen wielder when he received it, and that it was actually the Keyblade that chose Riku due to the Bequeathing that Terra performed on him. However, due to Riku being weak and falling to darkness in Kingdom Hearts, Kingdom Key jumped over to Sora instead. This was able to occur since Sora reached out and touched Riku's heart during that moment. Riku would not gain another Keyblade until one year later on his path to return to the light.

Notes and references
Vererben