The simplest and by far the most consistent explanation for everything that happens in Twelve Monkeys is that there is exactly one timeline which cannot be altered.
Naturally, explaining everything in chronological order doesn't make for the most comprehensible explanation any more than it (ever!) makes for the most compelling story. There's also no point in reciting the story from Cole's perspective because the movie (and, for example, Wikipedia's plot summary) follows this very closely. So for the sake of novelty I will take a different perspective, that of the heroes of the story: the scientists.
In winter 1996/1997 a virus was distributed across the world. The virus soon mutated, no cure could be found, and some five billion people - 99% of the human species - died. The survivors retreated underground. It's now about thirty years later, and the scientist/rulers of the world are working to take back the surface of the planet. To do this, they need to gather a sample of the virus in its pure form, from before it mutated, and to do this they have developed a rudimentary form of time travel.
Because this form of time travel is dangerous, the people they choose to send back are convicted prisoners and many of the prisoners are mentally ill. During early attempts, the "volunteers" arrive far too far in the distant past, where some of them go down in history as doomsday prophets. "Science ain't an exact science with these clowns, but they're getting better. You're lucky you didn't end up in ancient Egypt!" Ignaz Semmelweis, mentioned in the movie as the father of germ theory, is possibly one of these volunteers. Some volunteers arrive in the more recent history and become conventional placard-wielding "The End Of The World Is Nigh" types: "You! You're one of us!" (Of course, presumably not all such people are time travellers.) Even the completely sane "volunteers" are taken as insane by the people they meet, as well as being cursed with the "Cassandra complex" Railly refers to in her lecture - "the agony of foreknowledge combined with the impotence to do anything about it". As a result, the scientists' information-gathering process is slow: "We've had some misfortunes with... unstable types."
The prophets in the Middle Ages would have had to hang around for years rather than days to make a mark on history. And at the beginning of the movie Cole notes that "none of the volunteers come back", although his cellmate Jose corrects him with a slightly updated rumour that some do. So it's likely that the "tracking" technology, whereby a tracker implanted in the volunteer's tooth can be used to bring the volunteer back to the present, isn't invented until later in the project, or that it malfunctions when a volunteer is sent too far into the past. Plus, at least one of the volunteers removes his teeth to stay in the past rather than return to the relatively harsh present.
As time passes, the time travel technology improves, meaning that volunteers cluster and become more numerous towards the end of 1996.
As well as sending people into the past (and occasionally successfully bringing them back to the present for interrogating), the scientists are collecting archaeological data in the present: photographs, newspapers and audio data painstakingly reconstructed from old voicemail messages. The information available to them is a confusing and contradictory hodge-podge of mostly garbage, analogous to the physical mess of technology that makes up their typical Terry Gilliam world. Circumstantial evidence such as the "WE DID IT" graffiti has led them to the conclusion that the self-proclaimed Army of the Twelve Monkeys is the organisation responsible for the virus being released. This is why, towards the end of 1996, Biblical Revelation types also seem to cluster around the building in Philadelphia where the Twelve Monkeys are based.
As we join the story the time machine is becoming more advanced and the scientists have run down their list of candidate agents to reach James Cole. As the scientists probably do to every volunteer, they tell Cole they'll be sending him back to October 1996 and give him a big smile and a lot of confidence. But they send Cole to Baltimore in April 1990 by mistake.
After a few days have passed, he is brought back to the present and interrogated. At the same time, they have also just finished decoding the first telephone call:
"The Freedom For Animals Association on Second Avenue is the secret headquarters of the Army of the Twelve Monkeys. They're the ones who're going to do it. I can't do any more. I have to go now. Have a merry Christmas!"
The scientists collectively make up a really interesting character. On the first impression they were sinister and ineffable, a vaguely malicious pantheon ruling a harsh, permanent underground dystopia and testing their dangerous experimental time machine on semi-willing live volunteers. It's when Cole comes back from his first trip through time that it becomes clear that this is an act. Cole tells the scientists that they sent him to 1990 instead, and their mask slips. Suddenly, they're looking around at each other, confused, double-checking their written notes, scrabbling to figure out what they did wrong. They aren't wacky trickster gods messing with Cole's life and brain for a lark; this is deadly serious and they really need it to work. Not only are the scientists the real heroes of the story, this isn't just an alliance of convenience: they and Cole really are on the same side.
Cole doesn't have a lot of useful information for them because of the mishap, but he has a promising lead: he met Goines, one of their suspects. The second time the scientists send him, they're much less clinical about the operation. The smiles and the encouragement are warmer and more genuine.
When Cole is brought home the second time, he has much more useful information to report. Cole reports - while "under the influence" - that he travelled to Philadelphia where he successfully connected the Army of the Twelve Monkeys with Jeffrey Goines and his father Leland Goines, a world-famous virologist. This information is hard enough for the scientists to act upon. They grant Cole the pardon he was working for. Cole successfully negotiates with the scientists, whom he now believes (or wants to believe) are hallucinations, to be sent back in time a third time. The scientists in turn believe that their information is essentially complete, so they agree. They provide Cole with their latest, most accurate information about the path of the virus, and send him successfully to 12 December 1996, the day before the outbreak.
This time, when they try to bring him back, it doesn't work. Cole has dug the tracker out of his tooth in order to stay in the past - that is, to stay sane - permanently. Then the scientists unscramble the dismaying second voicemail message:
"I don't know whether you're there or not. Maybe you just clean carpets. If you do, you're lucky. You're gonna live a long, happy life. But if you other guys are out there, if you're picking this up, forget about the Army of the Twelve Monkeys. They didn't do it. It was a mistake. Someone else did it. The Army of the Twelve Monkeys is just a bunch of dumb kids playing revolutionaries. Listen, I've done my job. I did what you wanted. Good luck. I'm not coming back."
The scientists are back to square one. All their data is for nothing. Cole, their best agent and the only person who might have the slightest idea where they should be looking instead, has gone rogue.
It's now the morning of 13 December 1996, and events become rapidly more confusing as we accelerate towards the pivotal scene at Philadelphia Airport. How much time has passed in the future is unclear, but it seems that much more information, solid information, has been gathered by the scientists by the time that they recruit Cole's cellmate, Jose. Jose is told the whole story and sent back to locate Cole to get him back on task, or to shoot Railly if he doesn't cooperate. (How do the scientists know about her?) Jose catches up with Cole at Philadelphia airport. (How did the scientists know where to find him?) Jose presents Cole with a gun. ("Who am I supposed to shoot?" Cole asks, but Jose disappears. It's a fair question. The no-brainer answer is "Peters", but the scientists must know that it is impossible for Peters to die now. Are they trying to make sure Cole has the weapon so that he himself is gunned down? So how do they know about that? And why are they trying to preserve a timeline which they know is indestructible? And who is the man with the white crew-cut?)
So now we hit the singularity. Events are passing too fast: plotlines are wrapping up so rapidly that the movie has to be slowed down to keep track of it all. While seconds pass in 1996, an arbitrary amount of time has passed in the future. The scientists have all of the information now. Their knowledge is perfect; their time travel technology is perfect; they know who did it and how and exactly where and exactly when.
One of the scientists, the one credited as "Astrophysicist", is sent back in time as promised. Arriving long before all the commotion, she books the seat next to Peters on his flight out of Philadelphia. During the flight, she'll steal a sample of the virus in its pure form and take it back to the future and then, in a matter of months, humanity will retake the planet.
Cole dies, and Railly will die too, but Twelve Monkeys has a happy ending.
Is Cole actually just "mentally divergent", and are the sequences in the future hallucinations?
I don't think so.
The movie is dense with pointers towards this conclusion, far too many to list here. The biggest problem is the World War I bullet retrieved from Cole's leg. The sequence in WWI could be a hallucination like the rest, but the bullet is a physical inexplicable object and it's Railly, not Cole, who digs it out and can't explain it. If Cole really is insane, then we're forced to conclude that the ballistics report scene, for which Cole isn't present, is also part of Cole's hallucinations, or that Railly has fully joined him in his psychosis and that the hallucination is hers. If we accept this, so much of the movie has been called into question that we might as well throw our hands up and settle for "Everybody is crazy; nothing in the film is literally happening", which is admittedly not unsupportable:
"Psychiatry, it's the latest religion. We decide what's right and wrong, we decide who's crazy and not. I'm in trouble here. I'm losing my faith."
...but is about as satisfying an explanation as "It's just a movie!"
In one of Cole's dreams, the man in the yellow jacket is clearly Jeffrey Goines, not Peters.
Yes, this is the third dream, occurring after Cole returns to the future the first time. This is the only thing in the movie which doesn't fit my "single unmodifiable timeline" reading, an outlying data point. On the one hand, it's just a dream, Cole isn't the world's sharpest mind, this is a memory from 30 years ago, Cole just ran into Goines for the first time but has never met Peters (and never will), and Cole has also just returned to the future, heavily drugged up. But on the other hand, Cole is by all accounts "a good observer" and the rest of the dream seems to stay fixed each time he has it. And as a third possibility, maybe this was just thrown in to stir the pot a bit and make everything line up a little less clearly.