What was the the purpose of following Mormon trail?

The church members were moving to the Salt Lake Valley to escape from persecution in Illinois and Missouri.