Federal trademark rights tend to override state trademarks, if they are senior in time and use. In other words, there is no simple "trumping" rule that says a federal registration will supersede or undermine a state trademark (which is registered at the state level or not.) So it is also possible that while a federal registration my enjoy rights in 49 states, if the mark was used in a single state prior to the registration and continues to be used, then it may remain unaffected or actually challenge the federal registration's enforcement in that state. So if there is an actual commercial interest at stake here, I suggest you consult with an attorney familiar with trademark law to conduct an analysis to see what your best options are.
I hope this helps.
Disclaimer: This answer is for informational purposes only and does not constitute general or specific legal advice, nor create an attorney client relationship.
As noted by Mr. Wahab, trademark rights arise only through the use of the mark -- not through a trademark registration of the mark (be it a state or federal registration).
So ... the first to use a mark owns the exclusive right to use the mark (and all confusingly similar marks) to brand a particular good or service. Those rights exist, however, only in the geographic region where the mark is used. The registration of those rights, while a very good idea, is not required.
So ... if someone uses a trademark in California before someone else uses the same mark elsewhere on the same or related goods then the subsequent user's federal registration cannot prevent the prior user from continuing its use of its mark. The prior user cannot, however, expand its use of the mark beyond the zone of natural expansion of its business (the scope of which will depend on each situation).
On the flip side, if the California user of the mark begins its use after the person who has obtained a federal registration began its use then the California user's state registration affords it no protection. NOTE, however: the senior user of the mark with the federal registration cannot stop the subsequent user from using the mark in California unless the senior user actually uses the mark in California. Remember, trademark rights arise only through use -- no use by the senior user in California then no rights in California. Once the senior user does begin use in California the subsequent user must stop its use.
In short, there is no battle between state and federal registrations of a trademark -- the battle is over who owns the trademark rights in what geographic areas.
Messrs. Wahab and Ballard did a great job with this question. I would only add that state trademark registrations are particularly misleading because they frequently will be issued based on a much lower standard than that required by the United States Patent and Trademark Office. In some states registration is merely a matter of filing the paper. Thus it is entirely possible for someone to have a state "trademark registration" for a trademark that would have have been recognized at all under federal law -- or, indeed, in some cases even for that state's own common law "unfair competition" or trademark law! It is also possible that a state trademark registration may be on file for would-be trademark that has failed to maintain its eligibility for trademark protection, even if it was legitimate when filed.
To be fair to the states, they could hardly institute a state-level model of the U.S. Patent and Trademark Office. The cost is absolutely prohibitive. For that reason no state even comes close to trying.
I am not admitted in California, but from the information I see online I can tell that California's process is someone more meaningful than that one, but it is worth noting that the page linked below from the California Secretary of State says, "The applicant is required to state whether they [sic] previously sought to register the mark with the United States Patent and Trademark Office and, if registration was refused, to disclose the reasons why it was refused at the federal level." You can infer from this that there are applications that have been rejected at the federal level but which California would at least considering registering. That is a pretty good hint about the relative strengths of the California registration.
I echo the prior comments that trademark rights arise through the use of the mark, and that the first to use a mark will obtain the trademark rights to use that mark. In addition to who first used the mark (the senior user), how the mark was used, and with which goods or services the mark was used are other factors to be considered as to who has superior rights and whether there would be a likelihood of confusion between the two users of the mark. That being said, there are certain advantages to a federal trademark registration. For example, as noted by Mr. Ballard, a senior user with a federal registration will have federal rights that can be relied upon to prevent a subsequent user with a California registration from using the mark in California. If you are considering whether to file for a federal or a California registration to protect your trademark, you should consult with a trademark attorney.