Everything on the island was real. "What happened, happened." All of the craziness, the weird science, the Others, the Dharma Initiaitive, etc....it happened. It all led up to Jack saving the afterlife by putting that cork in the cave to "re-light" the light. Desmond was the weapon, as Jack said...he was able to make the light go out in time for the Man in Black to become mortal and be "killable." Remember -- Desmond was a "failsafe." Jack, as the protector of the light, had to ensure that the light was restored. Had he not done that, the world would have ceased to exist...as well as the afterlife (a place where you are with the people you love most. Desmond alluded to this, but I do not believe when he went into the cave that he realized that it was death/afterlife...I think he thought that he would still be "alive" (hence his original sadness when the light went out and he opened his eyes and didn't see Penny. It wasn't until he died, had the awakening experience with Charlie until he realized that this beautiful place where you are surrounded by everyone you love is actually the afterlife.
The sideway storyline was their tunnel from their physical death into the afterlife. According to Christian Shephard, no one crosses into The Light (the afterlife -- heaven, or whatever else you believe in) by themselves. They cross over with the people who they experienced their most important time in their life with. The sideline universe is what they created to get from death (throughout the sideline stories, they were all already dead) to a place where they could find each other so that they could "let go" and move on...to the afterlife.
All of them died at different times. The people that died on the island, really did die on the island...the people who got off of the island in the end on the Aijra plane (Kate, Sawyer, Miles, Claire, Lapidus, and Richard) lived a longer life but as Christian says, "Everyone dies." So, they could have lived full lives...but in the end...after their death, since they spent the most important years of their life on the island together...these people are all supposed to move on together into The Light...