It has not been explained in the show yet, and without knowing more about the mechanics of time travel within the Flarrow universe, there's no way to give a definitive answer. But, two major possibilities present themselves:
Stable Time Loop
One common trope in time-travel fiction is the concept of a stable time loop, also known as the Predestination Paradox. In this type of time-travel system, it's perfectly acceptable for cause and effect to create a loop, where event X causes event Y but event Y ripples back in time to cause event X. It's allowed because it's stable -- as long as the future events happen correctly, they will cause the past events, which will in turn cause the future events, etc.
To accept this idea, you have to basically give up the idea that cause and effect form a "straight line", in which you can always trace things back to the "first" event; in a stable time loop, there is no such thing as the "first" event; each event in the loop causes the one after it and was caused by the one before it, in a never-ending cycle. (Several examples of this can be found in Doctor Who, where time travel is a routine part of the show.)
There is some evidence that this is the direction The Flash is taking things; Wells chastises Barry for "changing the past" and that causes bad things to happen in the future. This would be because Barry created an unstable time loop; by doing something the past, he's changed the sequence of cause/effect that led time to time-travel in the first place, and that's bad.
By contrast, the events leading to Barry becoming The Flash are stable. As long as
FutureThawne goes back in time to become Well,s start Star Labs and cause the explosion
then the timeline of Barry's life will always play out the same way. Even if the details change, as long as the chain of cause and effect events keep happening, time is satisfied.
This theory has a lot of support from the comics; specifically, it's the central plot in the cross-over event called Flashpoint. During that event, Barry Allen travels back in time to prevent Thawne from killing his mother, and in doing so, shatters all of the timelines of all parallel universes, completely changing history. As a side-effect, Barry ends up removing himself from all chains of cause and effect, becomine a "living paradox". Thawne believes that this new situation will let him kill Barry, without losing his own Flash-derived powers.
The other major way that time travel works in fiction is that people who change the past create an alternate timeline. Sometimes, there is an idea of a "split" timeline, where the original history remains intact and a new one splits off at the point of divergence. Other times, the original timeline "disappears" and a new one takes its place.
In this setup, Barry would have originally gotten his powers some other way, a way that we are not (yet?) privvy to. At some point in the future of this original timeline,
Thawne goes back and kills Barry's mom and starts Star labs, etc.
thus creating a new timeline, which we are seeing play out.
This scenario is a bit harder to justify within The Flash, mostly because Wells keeps checking the news paper from "the future" to see if things are going well. If there were alternate timelines, that would be a senseless idea: there would be any number of possible futures where any number of possible events happened, and no way to specify which one was "right".
However, this theory does have some support from the source material. Specifically, the origin of Eobard Thawne includes several instances where he traveled back in time to change his own past, creating a variety of alternate timelines.