The elves left Middle Earth because of a great war between the elves and the dark lord Sauron. The elves were tired of the constant conflict and wanted to find a place where they could live in peace and harmony. They decided to leave Middle Earth and head to the Undying Lands, a magical realm that was outside of the mortal world. There, they could live in peace and safety, away from the dangers of the mortal world. The elves had been promised this land by the gods, and they took the opportunity to finally leave the mortal world behind.