Depends on the story, and IIRC it has shifted with time. But yeah, the general trope is they are stuck in a small vessel, and they offer/are extorted into one or more wishes to free them. Why they are stuck ranges from evil sorcerer trying to enslave them to noble hero stopping their rampage.
He had his three wishes and none of them actually do anything. It doesn't matter if they make any sense or which ones would be executed. The Genie can just go back into his lamp and chill.
It is quicker now in Windows, at least if you're trying to interact with the program. It might take 30 seconds for the message queue to fill up without any user input, but I've had it pop up asking me if I wanted to kill a game that was doing some loading in it's UI thread and neglecting the message queue when the total loading time was maybe like 20 seconds and I was clicking to see if it was hung. After understanding that it just takes a while and waiting patiently, the "should I kill it?" message doesn't pop up.