The first time it happened, Sunset didn’t pay it any mind due to the circumstances. The second time it happened, she thought it was simply the action of a concerned friend. The third time it happened, she realized Rarity was flirting with her.
Getting rejected by Sunset leaves Twilight holed up in her room. But when Rarity comes asking for help, Twilight can't ignore a friend. Both of them have a lot to learn about rejection, each other, and if a friendship really can become more intimate.
Remember when Sunset yelled at Twilight for putting everyone's lives in danger? Well, Rarity does, and she's a bit confused—after all, how could their lives be in danger when it's quite literally impossible for humans to die?