Karma is always balancing things and the evil genie experienced that on his own. As he wanted the death of the fisherman, he ended up locked back in the vase as he wasn't flexible on the fisherman's destiny. Why would you want to kill somebody that saves you? Well, karma is a b**ch and it got you back!
RE: One Thousand and One Nights: The Story of the Fisherman with the Efreet: Second Night