Why does the First to File get the Protection?
Once an application or a registration is in the Trademark Registry, the trademark is used to bar other, subsequent applications from registration in the USPTO. This means that, once filed, your trademark gains the benefit of that earlier filing date to "overcome" other, later trademarks that attempt to register.
It is not always the case that the first filed gets the protection, however. A trademark application can be challenged if a subsequent filer started using the mark previously. However, that is a big process and would take place during opposition, not through Examination. Oftentimes, we have seen applications pass through the system to allowance, even though a previous, common-law use existed. In that case, the earlier user cannot be prevented from using the trademark, but they can be prevented from expanding their use geographically, for example.