The jar of dreams is a rare drop from The Nightmare found in the Sisterhood Sanctuary.
When players have the jar in their inventory while casting the Dream spell from the lunar spellbook, the screen will slowly turn black, and The Nightmare's face will show up, together with the sound of the Armadyl crossbow's special attack.
The jar can be used on a boss lair display in a player's Achievement Gallery to have a display of The Nightmare. Doing so requires killing it at least once.
For an exhaustive list of all known sources for this item, see here
A player casts the Dream spell while having the jar in their inventory.