This is multiple theories wrapped into one. Sorry if it seems as if it jumps around, but if you sat through season five, I'm sure you can handle it.
Jacob and the Man In Black are in a game to determine the nature of humanity, whether they destroy (as is the MIB’s position) or something else (which is Jacob’s). Jacob wants to prove his point, so he frequently brings people to the island (his “pieces”). This also means that the MIB gets to choose pieces as well to counter Jacob’s moves. This can also be done indirectly, just so long as they’re chosen specifically.
Let’s do a rundown of some of the pieces (specifically the ones I’ll be discussing):
-Kate (touched by Jacob)
-Jack (touched by Jacob)
-Sawyer (touched by Jacob)
-Locke (touched by Jacob and “recruited” by MIB via Widmore via Abbadon)
-Sun (touched by Jacob)
-Jin (touched by Jacob)
-Hurley (touched by Jacob)
-Juliet (recruited by Jacob or MIB via Richard)
-Ben (recruited by the MIB directly in the cabin and Jacob via Richard)
-The freighter people (recruited by Jacob or MIB via Widmore)
-Illana and Co (recruited, but not touched, by Jacob)
-Anyone on lists (either MIB or Jacob)
I’m of the opinion that since Ben believed mistakenly that Jacob was in that cabin, he was actually letting the MIB choose pieces (thereby choosing Eko, Michael, and possibly Juliet for the MIB). Also, Miles seems to be the only one of the freighter people to be picked by both the MIB and Jacob via the freighter people and Illana’s squad.
Anyone else on 815, 316, or the various other people are extras in the game, but able to change the course of the game. Since Frank was chosen, this is why Seth could be killed (he wasn’t chosen by either side). Seth was also used to try and make the 815ers find a way off the island therefore stopping that round of the game.
At some point the MIB dies and gains certain abilities, (the ability to mimic the dead, the smoke thing that he does, reading people, etc). The reason I believe that he's dead is because we haven't seen Titis Welliver's version of the MIB since "The Incident" flashback in the distant past. The cabin, I think we can agree, was inhabited by the MIB, (hence the ash and Illana saying that Jacob hadn't been there in a long time), but an ethereal version of him (hence the fact that he only was kind of there). How he died is irrelevant, but I theorize that he's deceased, but more powerful because of it (in an Obi Wan kind of way).
Jacob's death gave him additional power as well. He tends to directly confront those he chooses to do certain tasks and make them decide for themselves to do them or not (kind of like Ben does). It was only in death that Jacob could directly pick people up and bring them somewhere (by which I mean flashing the '77-ers to '07).
Conversely, the MIB prays on peoples' weaknesses (hence his philosophy that people come and destroy... they're weak). This is why he killed Eko, because the MIB could no longer use his guilt for Yemi's death to control Eko. Hence Christian (Jack), hence Alex (Ben), hence Boone (Locke). To bring them all back to the island to detonate Jughead, the MIB took the forms of many of the island's dead residents to manipulate them to come back (i.e. Christian telling John to tell Jack "hi"). This would accomplish a fourfold goal:
1. It would once again prove that humans can only destroy
2. It would ensure that Dharma (and possibly the others) were wiped out.
3. It would keep Des and 815 from getting to the island
4. It would sink the island, effectively ending the game, (to quote Jacob "it only ends once" and the destruction of the island seems like a definitive end).
I suppose I should put this here: Claire's not dead. The MIB can't be in two places at once (hence Fake Locke, dead Alex, and the Monster never being in the same place at the same time) and if Christian is the MIB, and Claire and Christian were in the same place, Claire isn't dead. Christian was ensuring that Aaron would be raised "by another" by dragging Claire away somehow. This works for the MIB's advantage.
Certain pieces can’t be taken out of play, particularly if they want to stay “in play” (on the island) or if the person that recruited them lets them live. This is why it’s important that the MIB and Jacob recruited John Locke. Since both of them could let him live or die, the MIB bided his time while Jacob saved him until Ben killed him off island to bring all of the pieces he wanted back. Normally, he wouldn’t want anyone back on the island, but he had devised a plan involving the aforementioned goals as well as manipulation (specifically of Jack by Christian via Locke). He was then able to put the pieces back on the board since he was controlling the people who moved the wheel. He kept Ben and Sun in 2007 (while dead Locke may not have been able to be moved through time, like Charlotte), and those instrumental in getting the bomb in 1977.
Okay, back to Jacob. Jacob, upon his death, could physically bring people somewhere. Now, the reason that he doesn't just bring everyone to the temple is because everyone has to do certain things, not just exist in a certain time and location. They have to do the action, and neither Jacob nor the MIB can MAKE anyone do anything. Because of this, Jacob brings the 77-ers to 2008. As with everything, there are rules to this. Jacob could only bring the pieces that were picked and he could only bring them at a certain time. This is why he didn't just get killed by Ben and go back to before they dropped the bomb. This certain time was determined by how long the Ajira crew had been on the island. If Ben was back three days before killing Jacob (I don't actually remember how long it was, that's just an example), the rest of the Ajira crew had to be there for three days as well. It's a rule so no one cheats or else everyone could just loop back around forever.
So, let's get to the end of this. The bomb was dropped. As Juliet was hitting the bomb, Jacob transports them through time to 2007 since at the same time compared to the Ajira passengers, Ben kills Jacob. The bomb is still there in 1977 and things are still being sucked down the hole, possibly causing the detonation and an end to the MIB's game in one very distinct timeline ("LA X"). On the other hand, whatever happened, happened and Jacob's picks are all in 2007 to finish Jacob’s side of it. So, in the parallel timeline began in “LA X” Jacob lost. The other timeline has yet to be seen.
How did Juliet know it worked? Well, she’s been on the island a while, experienced headaches and nosebleeds and got transported through time again, but in a different way this time since they DID change the future, therefore she’s living the parallel 2004 timeline and bringing the information to 2007 (like Charlotte was able to relive events from her past, gain the information about the well and Daniel and bring it to the future). So, it’s possible that Juliet died from being displaced in time, like Charlotte, but that seems irrelevant since she probably would have died of her injuries anyway.
Rundown of what was discussed:
-MIB and Jacob choose pieces (sometimes both choose the same one)
-MIB wanted the detonation and orchestrated it that way
-Jacob made one last timeshift, but after the bomb was dropped, the detonation happened after this
-MIB wins in 2004 “LA X”
-Jacob is still playing the game in 2007 timeline
-Juliet’s consciousness slipped through the parallel timelines, letting her know that the bomb worked