According to the generally accepted version, the unfortunate comedian became the Joker when he participated in the robbery of a factory. Frightened by the guards, he fell into acid and went mad. At the same time, a forced smile froze on his face.
The Joker performed atrocities until he was stopped. He was detained in a psychiatric hospital.
The Joker did not want to know the truth about his former self. It is very likely that he was kept in the hospital not as in prison but because he is indeed mentally ill.
Until now, no one knows how and why the Joker joined the ranks of the Earth's defenders in Mortal Kombat.