Thousands and thousands of years ago, maybe even before Agrabah was founded Genie had a master named Al Gebraic. He was a greedy master who, after he used up all three his wishes sold Genie to a magician for eternal life. But not enteral youth. Living for such a long time can getÂ Â bored, Al Gebraic has seen and done everything so to get some companionship for the rest of entirety he hired a Muktar to bring him Genie.
What he didn’t and couldn’t forsee is that Genie got a friend that wouldn’t let him just capture. He sees Genie as a servant not as a friend and when he asked Aladdin why he would die for his servant Aladdin replied. “Not for my servant. For my friend.”
And so after seeing the friendship between Aladdin and Genie he set him free, for now. Because he knew that someday Aladdin would die and then he could.