"And it came to pass that the Lord commanded my father, even in a dream, that he should take his family and depart unto the wilderness."
Ever commandment given to people from the Lord is for both the spiritual and physical benefit. For Lehi it was for physical protection and spiritual strength and preparation for the further knowledge. by being diligent in keeping the commandments of the Lord they were prepared for what was to come.
By following the Lord Lehi and his family would be led to a better land. A place promised by God to be a land choice above all others. The Lord does not forsake His children, He leads them safely to a place He has prepared for them as can be seen by the example of Lot, Moses and the Israelites and so on.