So, if you invent something today and filed a patent next week, you could still get a patent over somebody else who independently thought of it and filed for a patent tomorrow, as long as you had proof. That's because you were the "first to invent".
Today, however, the other party would get the patent because they were "first to file", even if you have all the proof on the world showing you were first.
Seems unfair? It sort of is, so why the change? Because 1) it's what the rest of the world does, and 2) it happened so very infrequently and the hassle of resolving it was relatively so great, that the US optimized for the common case and got rid of it completely.
Note that prior art is entirely orthogonal to all this. It still applies to all patent applications as before. In this case, if prior art exists that pre-dates both parties' dates of invention / filing, both would end up without patents