An Occurrence at Owl Creek Bridge is neatly divided into three sections, the first and last longer and the middle one shorter. Section two provides the explanation of how and why the protagonist, Southern civilian and self-appointed saboteur Peyton Farquhar, has come to be standing on Owl Creek Bridge, waiting to be hanged. Strictly speaking, an explanation is not necessary—the story would still work if we knew nothing more than that Farquhar is a Confederate being executed by Federal soldiers—but it deepens the reader's appreciation and understanding of Farquhar's situation and therefore increases the emotional impact of the brutal surprise ending.
However, while the background is important, it would have been a mistake for Bierce to follow chronological order and place it at the beginning. To do so would have drastically reduced the impact of the story. To begin in the middle of the action, so to speak, with Farquhar's neck already in the noose, grabs the reader's attention and makes him or her want to read on and find out what is going to happen.
As for the facts spelled out in section two, they reinforce the story's sense of bitter irony, which is typical of the author, a Civil War veteran who expressed disillusionment about war and its aims. We learn that although Farquhar apparently did try to destroy the Owl Creek Bridge, he was entrapped into doing so by a Federal "scout"—really a spy—disguised as a Confederate, who suggests to Farquhar that the bridge would be easy to burn. There is a deep and very effective irony in the fact that Farquhar is being hanged from the very bridge that he tried to sabotage. This plot twist may increase the pity we feel for the condemned man as he imagines that he has escaped his captors and is about to rejoin his family. But then again, it may simply reinforce our sense that war is absurd.
This story is divided into three sections. The first section takes place in the present and describes the scene of Farquhar's hanging. Flashback is used in the second section of the story to tell the reader how Farquhar ended up at the end of a rope about to be hanged. Information given in a flashback is needed in order for the reader to better understand the character and the present events of the story. The flashback in this story is very important. We learn in the flashback that Farquhar was set up by Northern soldiers to try to destroy Owl Creek Bridge. This develops more sympathy for Farquhar and greater understanding of his act to try and burn the bridge. We don't just see him as a renegade but also as a family man. We also get some of Farquhar's feelings in this section. I think it makes us more willing to believe that Farquhar just might have escaped the noose and is on his way home. By making it more believable, we are more shocked by the ending of the story.
Bierce strategically places the flashback on section two for three reasons:
1) to maintain suspense as to Peyton's fate; Bierce breaks an otherwise linear timeline in order to "trick" the reader into hoping that Peyton might somehow, miraculously, escape the northerners.
2) to inform the reader about the circumstances which led to Peyton's hanging.
3) To establish that the narrator is an omniscient one whose story is taking place in about 10 seconds of real time, whereas the "story time" is several days longer.
The function of the flashback in section two is backstory. Without it, the reader would never learn what, exactly, Peyton did to get arrested. Plus it sets the scene for section three, his "escape." It also adds to the irony of the story, in that the reader learns that Farquhar was tricked by Northern soldiers into trying to destroy the bridge. Without section two, the reader would never know why he was being hanged. They also wouldn't know he had a family, that he was a plantation owner, or where he was headed when he "escaped". It also explains why he tried to destroy the bridge, which is because he could not fight in the war for reasons Bierce felt weren't worth mentioning in the story.
The flashback scene in section two of of the story is placed where it is for a variety of reasons, but one of the biggest is for appeal. The way the story starts out, in medias res (which means it starts in the middle of the story), grabs the reader's attention with a lot more strength than it would have if he kept the timeline intact. By starting in the middle of the story, it makes the reader start to wonder what this man did and why he is at the end of a noose.