Jafar's Lamp is a Magic Lamp.
An inky-black, twisted reflection of the good Genie's Lamp, this Magic Lamp sprang into existence when Jafar used the Genie's power to turn himself into a genie as well. Due to it being an inherent quality of Genies to be bound to a lamp until they are freed, Jafar (alongside Iago) was sucked into the lamp a few seconds after the transformation was complete. The Genie then sent the Lamp to the Cave of Wonders, to be kept sealed within its confines for 10,000 years — which the Genie hoped would give Jafar time to "calm down".
However, likely due to being a conjured replica rather than the real thing, this Lamp was somewhat weaker than the original; while it was able to contain Jafar himself, Iago could squeeze himself out (albeit with great effort). He exploited this loophole in several attempts to escape, both with and without his master, until a particularly brazen attempt by Jafar at returning to power led to the Lamp's destruction in a lava pit and Jafar's temporary death.
Behind the scenes
This Magic Lamp was first seen in the 1992 animated film Aladdin, and has made numerous appearances in related media until its on-screen destruction in The Return of Jafar. A lamp identical to Jafar's Lamp is once again Jafar's prison in Wish At Your Own Risk and Sorcerers of the Magic Kingdom despite both taking place at later points.