Many of the in-depth details used are from the Wookieepedia, the Star Wars Wiki.
Background
Star Wars is an American epic space-opera media franchise created by George Lucas, which began with the eponymous 1977 film and quickly became a worldwide pop-culture phenomenon. The franchise has been expanded into various films and other media, including television series, video games, novels, comic books, theme park attractions, and themed areas, comprising an all-encompassing fictional universe. The franchise holds a Guinness World Records title for the "Most successful film merchandising franchise".
The original film, retroactively subtitled Episode IV: A New Hope, was followed by the sequels Episode V: The Empire Strikes Back (1980) and Episode VI: Return of the Jedi (1983), forming the original Star Wars trilogy. A prequel trilogy was later released, consisting of Episode I: The Phantom Menace (1999), Episode II: Attack of the Clones (2002), and Episode III: Revenge of the Sith (2005).
Star Wars Legends, formerly known as the Expanded Universe (abbreviated EU), encompasses every one of the licensed, fictional background stories of the Star Wars universe, outside of the original six Star Wars films produced by George Lucas and certain other material such as Star Wars: The Clone Wars, created before April 25, 2014. It is derived from and includes most official Star Wars books, comic books, video games, spin-off films, television series, toys, and other media created before that date. This material expands and continues the stories told in the films, taking place anywhere from over 36,000 years before The Phantom Menace to 136 years after Return of the Jedi. The issue of which aspects are canon was one of the most hotly debated topics among fans.
On April 25, 2014, Lucasfilm Ltd. announced that in preparation for the upcoming sequel trilogy, the Expanded Universe would be retconned; past tales of the Expanded Universe will be printed under the Star Wars Legends banner, and a new continuity has been established that consists only of the original six films, the Star Wars: The Clone Wars television series and film, and all future material from that point onward. Though past elements of the Expanded Universe have been declared non-canon as a whole, they remain a resource for future Star Wars material to reference, thus bringing these elements into the new continuity as canon. Today, the only Legends product that is still being released is the video game Star Wars: The Old Republic, along with short stories published at the Star Wars blog.
The Expanded Universe had a continuity with a few wrinkles. The general rule was that nothing in the Expanded Universe was allowed to contradict any other part of the Expanded Universe or the films. The films, however, do slightly contradict the Expanded Universe on occasion, and retcons were created in the Expanded Universe to fix these contradictions. In the absence of such ad hoc solutions, the EU is considered incorrect only on the particular points of contradiction.
The Expanded Universe is actually older than the films themselves, as the novelization of the original film was published six months before the film was released. In in-universe chronology, the earliest works are the Dawn of the Jedi comics, which are set millennia before the films, while the latest are the Legacy comics, which are set about one hundred and thirty years after Return of the Jedi.
The Expanded Universe was intended to be a continuation, and an expansion, on the six Star Wars theatrical films produced by George Lucas from 1977 to 2005. All EU material, combined with that presented in the films, was meant to function as a complete story. However, in order to allow this story to function as a whole, it was kept in an order of continuity. Lucasfilm held this of such high importance that a team's sole job at Lucasfilm was maintaining continuity between Lucas's films and the EU, which was created by many other authors and artists, many times out of order, and with many different ideas. Though it eventually was erased from main in 2012, when Disney acquired the rights to the Star Wars franchise; and as such split the continuities in twine.