The Black Mercy was a telepathic, plant-like species alien to Earth. It attaches itself to a host, reads the host's memories, then traps the host in a waking dream state based on the host's deepest personal desires. What the Black Mercy received in return for this state is unknown.
Mongul sent a Black Mercy to Superman to incapacitate the Kryptonian as part of a plan to conquer Earth. The Black Mercy gave the Man of Steel a dream where Krypton never exploded. In his dream, Kal-El was a farmer with a wife, a son, and a personal robotic assistant called Brainiac. Jor-El was a disgraced scientist due to his apocalyptic predictions of a destruction Krypton never suffered. Batman tried several ways of removing the alien plant from Superman in vain. Once Superman realized that the dream wasn't real, Batman was able to pull the Black Mercy free.
As he pulled the Black Mercy free from Superman, it attached itself to Batman. Batman's dream state began with the young Wayne family's fateful encounter with Joe Chill. In the dream, Thomas Wayne was fighting off the mugger with young Bruce cheering him on. As Batman realized he was dreaming, the mugger got the upper hand in the struggle. The confrontation ended as it had in reality, allowing Wonder Woman to remove the Black Mercy.
Wonder Woman barely avoided getting caught by the plant herself. She threw the plant at Mongul, incapacitating the former warlord. While Mongul's dream state is unknown, Batman stated that whatever it is "was too good for him".
In DC Comics, the Black Mercy was used by Mongul as part of his revenge against Superman for ruining his chances to obtain War World. Following the Crisis on Infinite Earths, the Black Mercy plant was retconned to be a symbiotic species created by Mother Mercy, a sentient plant organism, and were intended to latch to terminally ill sentients and give them a happy, painless death. Mongul the Lesser (Mongul's son) later used several in a plan to kill Mongal (Mongul's daughter).