Five-tailed foxes were extremely rare spirit beasts. They were hunted almost to extinction in the past due to the many benefits their organs provided for cultivators. They were not strong enough to retreat deep into the wilderness. The spirit beasts there would devour them because they were also excellent nourishment for other spirit beasts. Hence, the few surviving ones had learned to stay near human habitat while remaining in hiding.
For Lin Li to find someone like Madam Lin, who willingly sheltered her, was something she considered a miracle.
She met Madam Lin due to a coincidence. She was running from a group of cultivators who hunted her after hearing about the rumor of her existence. She was wounded by them. She entered Hei Mansion to hide during her flight.
She fell asleep inside the mansion because she was too tired. Before she did, she transformed into her human form, just in case someone wandered in.