Kirito and Asuna didn't know each other prior to playing Sword Art Online, but they develop a bond as real as any IRL relationship. In the virtual world, they go on dates, get married and even raise a child.
Before they find Yui, the loving pair are taking a break from monster-killing and living in a log cabin. While there, Kirito hears a couple of rumors about the woods of Floor 22. He mentions there is supposedly a ghost dressed in white that roams the area, and that ghosts are supposedly the result of slain monsters' grudges. Asuna is scared when she sees a white-clothed girl from a distance, but when the two get a better look at the girl, they realize that she isn't a ghost at all.
When the girl passes out, Kirito and Asuna take her into the cabin to plan out the next course of action. They eliminate the possibility of her being an NPC due to the lack of an outside prompt. Once Yui wakes up, she doesn't recall any of her past memories, not even being able to speak clearly due to her condition. Kirito and Asuna spend the next while with her, bonding rather quickly with this lost girl while at the same time wanting to figure out where her family is.
Their first plan of action is to head for the beginning town, a place home to several children trapped in the game. Kirito and Asuna don't really want to lose Yui, but continue with this task by putting aside their feelings. They encounter the orphanage director and a few children who are stopped by the Aincrad Liberation Force, but these soldiers aren't any cause of concern for Kirito and Asuna. After Asuna makes quick work of these soldiers, Kirito and Asuna walk to the orphanage itself.
At the orphanage, they don't receive any leads for Yui's family. Despite the orphanage taking in many people, they don't recall anyone who could be related to Yui. Yui's origin is revealed while Kirito and Asuna help a member of the Aincrad Liberation Force to rescue Thinker from an underground dungeon.
Yui is an AI who originally monitored the health of the game's players. While she wanted to help many people who were in mental distress, the Cardinal system refused to allow her to interfere. Therefore, throughout the beginning of the game's existence, Yui was forced to passively watch people suffer. It's as she was observing people that she encountered Kirito and Asuna, who expressed a happiness rarely seen among players. Yui wanted to be with them, and by sneaking out into the game, she got that chance.
The moments before Yui was going to be deleted solidify the parental feelings Kirito and Asuna have for her. While in the beginning they allowed for Yui to call them parents due to her lack of memories, it's as Yui says her goodbyes that the pair is emotionally struck. Asuna confesses that she can't smile without Yui while the three of them break down together. Yui only wants to stay with her new parents, and as the system tries to delete her Kirito answers her wish.
Due to Kirito's expertise in using the system, he manages to save Yui by turning her into an item. Through the rest of their time in Aincrad, Yui is stuck in this inanimate form. She would eventually be freed from her item status when Kirito is freed from the game, accompanying her parents on their future adventures. This is how Kirito and Asuna develop a familial bond that disregards Yui's true nature as a program.