Who wrote? Nephi wrote 1 and 2 Nephi as an older adult after already reaching the Promised Land.
Why? He was writing his testimony and how the Lord has blessed him in his life. His story was not about Lehi, Jerusalem history, or even his brothers. It was his life and what he had been inspired to teach. He was instructing his audience using examples from his own life to teach the gospel and the "tender mercies of the Lord". At least that is in 1 Nephi. It is the Book of Mormon's exodus story. In fact, writers from BYU have compared Lehi to Moses (and Jacob) Nephi even uses Moses as an example. 1 Nephi is the Exodus of the Book of Mormon.
What happened? Lehi was called to preach repentence to the Jews. He did so. Why did Nephi include this? This was the beginning. This is when things changed. Lehi's life and possibly his family was threatened. We know Jeremiah was thrown in prison and tortured at this time. Lehi kept preaching.
Lehi was called to leave Jerusalem. That was not unusual at that time. We know that others left Jerusalem. Then Lehi was called to do something different. After the long journey to the Red Sea and beyond Lehi told his sons to go back to Jerusalem to get the brass plates from Laban. That would be like me telling my sons to go to the National Archives to ask for a copy of the Magna Carta (if it was protected by a corrupt military leader like Laban) That was an exceedingly difficult thing for Lehi to ask his sons but they were willing to do it. Nephi did so after receiving his own testimony. Nephi asked God directly if what his father taught was correct. He received an answer and taught Sam who also believed. Laman and Lemuel did not believe and as far as we know never asked. They were products of their time. They went to synogogue, worshipped and prayed, but it was just a culture thing for them. Nephi got the plates by following God, Laman and Lemuel whined and were violent. Nephi not only got the plates, but he came out with a servant, Zoram. Nephi was very much like the followers of Moses and their successes when they followed the Lord.
Who was the audience? Laman and Lemuel and their followers played the role of the Israelites complaining in the desert. Nephi was like Joshua (who was also of the House of Joseph through Ephraim) or like Joseph of Egypt, who led his older brothers. Ephraim is the Head! says the scriptures. Joseph separated from Israel and later saved his brothers. There is a lot of emphasis on Joseph and Judah in Genesis. Ephraim led the Northern Kingdom and split from Judah, the Southern Kingdom. Judah and Joseph always separate, rejoin, separate, rejoin. So this remnant of Joseph, through Lehi's sons, also separated into a New Promised Land. The gospel was brought my Jesus who was of Judah of the Old Promised Land and restored through Joseph (Ephraim) in the New Promised with a separation of almost 2000 years.
We, of the New Jerusalem, are the audience. Anyone who follows Christ is part of Israel by adoption. The Book of Mormon is for you.