Shaking her head, Genie said aloud "I wish I knew how you became a genie." And suddenly, the information appeared in Genie's head. "I wish I knew how that wish just got granted." (After all, genies weren't supposed to be able to grant their own wishes.) Then, suddenly once again, the information appeared in Genie's head. Apparently, genies COULD grant their own wishes, but only within the confines of their own lamp. Well, this was interesting. At least she wouldn't get as bored as she thought she would, if she had to stay in the lamp for a long time.
As to the answer to her first wish, Josephine had become a genie because ...