The lamp was found by Webby among the pile of treasure of Collie Baba. She kept it to use for her tea set but as she started polishing it (rubbing it in the process), it magically released Gene.
It is revealed by Gene that the lamp once belonged to an evil magician named Merlock who had a way to gain unlimited wishes by placing his Talisman on it. However it was stolen by Collie Baba and his forty thieves and for centuries it remained lost until Scrooge McDuck came searching for Collie Baba's treasure.
After Scrooge wished Gene to be a real boy, the Lamp crumbled to pieces, since it no longer had a genie to inhabit it.