To put things simply, Riku is Sora's rival and closest friend. Riku is the first person that Sora loses to the darkness; Riku’s determinism to venture off to new lands is driven by his fearlessness of the dark. When Riku learns of the new friends Sora has made during his travels, he grows jealous, which turned into hatred, thus allowing his heart to grow weak. Riku misunderstands the situation and makes the assumption that Sora would abandon him and Kairi for them, and eventually turns against him. Riku seems to be easily possessed and persuaded, which becomes his ultimate downfall. However, in the end, he was able to relieve himself from the clutches of darkness, and risked his heart in order to keep the heartless from invading. Before he could return, however, he needed to compensate for what he did. He learns this the hard way, unable to return to his original form without blindfolding himself.


By the second game, Riku was still in the process of atoning for his actions, allying himself with DiZ and King Mickey. He asked King Mickey to not reveal his identity to Sora, ashamed for what he had done to him in the past. When he finally finds Sora in Kingdom Hearts II, he is in a form unrecognizable to him. By the end of the game, Sora and Riku leave the world together, agreeing to protect the world of light by being the darkness.
Sora’s relationship with Riku has been a peculiar one since their childhood days; though Riku and Sora are the best of friends, they maintained a healthy rivalry. It wasn’t until Riku and Sora left Destiny Islands when their relationship began to take a turn. Riku had turned to the darkness, leaving Sora worriedly chasing after him.