Swayamprabha describes who she is and how she became the caretaker of the cave in this chapter of the Kishkindha Kanda of the Ramayana:
A marvellous fantasist by name Maya was there, a bullish demon of wizardry and by him with his phenomenal expertise all this golden woodland is constructed.... Once he was the Universal Craftsman to the lords of demons by whom this divinely golden and superb mansion was constructed. But he on practising ascesis for thousands of years in this horrendous forest, obtained a boon from Brahma, the Forefather, which entails acquirement of entire wealth of Sage Shukra. That dynamic one methodised everything and then resided comfortably in this great forest for some time, privileged with all his wishes. Indra, the Administrator of Worlds and destroyer of enemy citadels, on taking His Thunderbolt eliminated Maya, when that eminent demon was engaged with an apsara, a paradisiacal nymph, called Hema. This marvellous woodland, these everlasting wish-fulfillers, and this golden mansion, are beneficed by Brahma for Hema. I am the daughter of Merusaavarni, oh, best monkey, named Swayamprabha and I am safeguarding this mansion of her, that apsara Hema.
Hema is a virtuoso in dance and music and my dearest nymphean-friend, and she bestowed a boon upon me [by which none can dishonour me, and thus] I am safeguarding this superb mansion.
So she is the daughter of the sage Merusavarni, who lived somewhere west of India as described in an earlier chapter of the Kishkindha Kanda:
In between Mt. Meru and Mt. Astaadri there is a gigantic ten-leaved Date-palm-tree, which is completely golden and shines forth with a marvellous podium. This is where the virtue-knower, an enlightened one by his own asceticism, a selfsame personality to Brahma and one renowned as Sage Merusaavarni indeed resides. And that sage Merusaavarni who is Sun-similar in his shine can be asked, only on your prostration before him in veneration, about the tidings of Maithili, and her whereabouts.
And she is taking caring of the cave on behalf of the Apsara Hema, paramour of the Asura architect Maya. Note that he's different from the Asura architect Maya who built Indraprastha; see my answer here. It's also interesting to note that Maya and Hema were the adopted parents of Ravana's wife Mandodari, so Hanuman and other Vanaras were trapped in Ravana's in-laws' house while trying to find Ravana!