The Final Chapter starts with two revelations
1. They have no clue how to get rid of their lcie marks because no one has ever attempted to, all lcie's have simply accepted their fate
2. Dysley needed to be eliminated, because even if they did nothing he would just continue to try and destroy Cocoon.
Doing nothing was out of the question, because as we saw with Vanille's story, it just created more problems. In this case, while they were doing nothing, Dysley put Cid Raine's as the primarch.
Cid Raines is the leader of the underground rebellion, and secretly in Dysley's pocket. By forcing Cid Raines in the primarch position, he made it look like he betrayed the rebellion and essentially forced the rebellion to start a coup de ta right then, which Dysley hinted would also destroy Orphan in process (Orphan being the giant battery that kept Cocoon afloat).
The group had to act to stop the rebellion from destroying Orphan as well as stop Dysley because he was just going to continue to find ways to destroy Cocoon.
When they arrive, Dysley also brings the entire Pulse army to cause massive chaos along with the public arrival of the l'cie. Lightning and co. battle their way to Orphan's Cradle only to see the rebellion was forced into being Cieth, because Dysley didn't actually think they could destroy Orphan, he just needed to kick the group's collective asses to get them there.
They decide to take out Dysley, and they do, but what they don't know is that Dysle's death triggers Orphan. Because fal'cie have no control over their wills or actions outside of using l'cie and focuses, and probably to goad the group into attacking it (because the final room has no door out iirc), Orphan attacks them.
Since there is no way to escape and they have no intention of dying, they destroy it.
Then it tries to tempt Fang to become ragnarok because Fang was the most likely to still destroy it to save Vanille and Dysley has been keeping track on all of them since day 1 and probably knew this. He changes everyone but Vanille and Fang into cieth to force a state of anger and drive her to become stronger.
This is where the deus ex machina comes in because Etros sees this happening, and immediately changes them back.
Thematically this part is suppose to show that humanity has the will and power to overcome any destiny forced upon them, as long as they chose to right. Lorewise: Etro sees how hard and emotionally they fight, is inspired and reverts them back into humans.
Etro is a moron but that's for the XIII-2 story.
Anyway, the final stage of orphan is them all fighting together, knowing that they have to because there's no other way out but also because they cannot let Orphan live if all he's going to do is engineer mass murder and then they just sort of... hope that they'll understand what to do next.
Then the ending, which is even more convoluted.