When and why did the Mormons move to Salt Lake City?

The latter day saints, or mormons, moved to Salt Lake City because the were being persecuted in every other state. The moved to somewhere that no one else wanted to be so the could practice their religion.