Alicia met Darkrai in the garden and befriended her. Bad Dreams is the name of Darkrai's Ability and it made people that were close and asleep near it to have bad dreams. Darkrai didn't usually appear around people because of this.
In Gaudy's diary, Gaudy wrote that Alice's grandmother Alicia opened Darkrai's heart by helped Darkrai when it was injured. Darkrai has stayed in the garden and it saved Alice as a little girl after she fell off a cliff.
Darkrai gained the trust of the people in Álamos Town after it protected them against Dialga and Palkia.