Three ingredients were chosen to create the fastest man alive — and no, they were not sugar, spice, and everything nice. In Barry Allen's case, they consisted of chemicals, a lightning bolt, and a particle accelerator explosion.
After paying Arrow a visit in Starling City, Barry Allen (Grant Gustin) returns to his laboratory where he works as a crime scene investigator for the Central City Police Department. During a torrential downpour, the forensic investigator casually walks through a puddle in his office and wastes no time getting to work.
Barry Allen is looking into his mother's murder case when he notices the news: It is announcing the activation of a certain particle accelerator (a.k.a. The Pipeline) created by S.T.A.R. Labs' CEO Dr. Harrison Wells (Tom Cavanagh).
The news channel originally claimed the weather should have no affect on The Pipeline, but the narrative quickly changes. The panicked news anchor reports that the storm "may have caused a malfunction to the primary cooling system" of S.T.A.R. Labs, thus urging an immediate evacuation of the facility.
The electricity in Barry's laboratory shuts off, immediately followed by the sound of an explosion. This entices Mr. Allen to look out the window at the nuclear cloud emerging billowing into the sky.
The origin is clearly S.T.A.R. labs, where you see lightning bolts emerging from each direction. Right about then, Barry was probably grateful he had Barry-ly missed the cut-off to stand in line.
A red sphere-shaped wave of energy shoots out from the explosion and rapidly engulfs Central City in a flash, followed by a city-wide blackout.
Barry rushes over to grab the chains that lead to his window. He was either hoping to close the window in order to prevent more rain from leaking in or to create a barrier between himself and potential toxins from the explosion.
He stops pulling on the chain, a strange look on his face, as if he could feel something. As he looks around, he notices the surrounding air has been affected because all the chemicals in the lab slowly begin to float upwards as if gravity were non-existent.
The ceiling window above him is ruptured by a lightning bolt, which strikes Barry in his core.
The force from being struck by lightning ejects Barry backwards onto his chemical shelves, where he is laying unconscious covered in broken glass and a concoction of chemicals.
Just as we begin to assume he's dead, we see red sparks creep their way through his body and settling in his brain.
The next scene depicts an unconscious Barry being rushed through the hospital to the emergency room, marking the beginning of his 9-month coma.
Barry eventually wakes up in a panic, only to find himself in S.T.A.R. Labs' facility. This only confuses him further.
Mr. Allen was treated during his coma under the supervision of Dr. Harrison Wells and his partners Cisco Ramon (Carlos Valdes) and Dr. Caitlin Snow (Danielle Panabaker). The latter explains to our bewildered Bar that he is in an inexplicable and chronic state of cellular regeneration.
It isn't long before things start adding up and Barry discovers his superpower: speed. Not only is he the fastest man alive (most of the time), but his speed also gives him super strength. His extreme speed also allows him to betray standard laws of physics, allowing him to defy gravity and even time-travel.
After drawing inspiration from Oliver Queen's (Stephen Amell) night job, Barry Allen will embrace his new-found abilities for the greater good of his city. Thus, The Flash is born.
In the comics, similar events take place to turn Barry Allen into The Flash. However, one major component is missing: the particle accelerator explosion. The mere lightning bolt combined with electrified chemicals sufficed to give him superpowers. He also did not fall into a coma, but was significantly dazed (as one would be after being struck by lightning).
There are surely different reasons behind the decision to add The Pipeline to the DC Extended Universe. For one, it makes it one step harder to recreate anyone like The Flash. Most importantly, it gives cohesion to the creation of metahumans, whereas in the comics, they all vary in explanations behind their powers.
Also, the addition of the particle accelerator explosion links Barry to other metahumans with a common thread. This further emphasizes the good in Allen's character, as he could have easily chosen the path of evil after gaining his abilities. Obviously, The Flash chose the righteous path since he spends his life fighting evil.