The law of jurisdiction of convoluted and inconsistent.
In general, in state courts, a court has jurisdiction over anyone who has a regular office for the conduct of business or permanent registered agent in a state on any matter (this is called "general jurisdiction") regardless of the location of a principal or main office of a business, and without regard to its place of incorporation (although every state requires that an entity incorporated there have at least a permanent registered agent in that state). State courts can also assert jurisdiction over someone if the suit that they are involved in has some appropriate connection to the state, even if the party sued or suing has no other connection to the state (a concept called "specific jurisdiction" or "long arm jurisdiction").
But, in cases where the claims of the Complaint arise under federal law, in most cases where there is a sovereign party, or where the is a "diversity of citizenship" and the amount in controversy exceeds $75,000, a case can be removed to federal court (or brought there initially). Diversity of citizenship must ordinarily be complete (in the sense that no plaintiff is a citizen of the same state as any defendant), but incomplete diversity (i.e. some plaintiffs come from different states from some defendants) is permitted in cases where there is collusive joinder of an unnecessary party to a lawsuit to manipulate the rules, in "interpleader" actions where multiple parties other than the party in possession of property claim ownership of it, and in large class action lawsuits; the cases that are exceptions to the complete diversity rule can also sometimes involve exceptions to the amount in controversy rule.
Parties are not considered to have citizenship for diversity of citizenship purposes everywhere that they are subject to the general jurisdiction of a state court. A natural person is a citizen of the state where he or she "resides" even if that person also has houses or business officers or permanent registered agents in other states. A partnership or limited liability company is a citizen every every state where a partner or limited liability company member is a citizen. An ordinary corporation (including a state bank) is a citizen of both the state where it is incorporated and the state where its principal place of business is located.
National banks (like Wells Fargo) are citizens of the state where they are "located" for diversity of citizenship purposes. A recent decision of the United States Court of Appeals for the 8th Circuit, determined that this is only the state where its "main office" identified in its articles of incorporation is located, even if this is different from where its principal place of business is located. Thus, according to the 8th Circuit, for diversity jurisdiction purposes, because it is a national bank, rather than a state bank, is South Carolina where its "main office" listed in its articles of incorporation is located, rather than its principal place of business in California.
Two other circuits had previously reached the conclusion that national banks are "located" both where they are incorporated and where their principal place of business is located, but in the face of a recent decision concerning Wachovia Bank, where the "main office" of the bank listed in its articles of incorporation and its "principal office" were the same, the issue was revisited in dicta, and one of the U.S. Court of Appeals Circuits that had previously made a contrary ruling reversed itself in a later case.
The consequences aren't all that huge. The substantive law that applies in a diversity action when a case is removed to federal court is the same as the substantive law that applies in any state court where a suit is brought if the state court had general jurisdiction or specific jurisdiction over the defendant. In all but a handful of states, the state rules of civil procedure for cases where at least $75,000 in controversy are directly copied from and interpreted in almost all respects consistently with, the Federal Rules of Civil Procedure, although there are sometimes some differences between federal and state civil procedure rule language or interpretion that matter in a particular case. Federal courts draw their juries from a larger geographic area than the specific county that is typically the source of a jury pool in a state court lawsuit, which can be quite important in personal injury lawsuits, but rarely matters very much in the most significant lawsuits of business deals gone bad (often simply very large collection lawsuits) which national banks typically find themselves to be parties.
Moreover, in cases like the jurisdiction case linked above, the primary forum for resolution of the lawsuit on the merits was a arbitration proceeding and the lawsuit was brought merely to confirm the underlying arbitration award under the Federal Arbitration Act because the business to business contract dispute involved had an arbitration clause in it. Absent a dispute that the contract containing the arbitration language was entered into at all, which was not present in this case, where the case is heard by a reputatable arbitration body like the American Arbitration Association, as it was in this case, arbitration awards are almost always confirmed even if there is good reason to believe that the arbitrator's decision was wrong in many material respects. A lawsuit to confirm an arbitration award where the validity of the contract containing the arbitration language is not disputed rarely requires significant in person evidentiary hearings that would make the convenience of the forum to witnesses relevant, and almost never calls for a jury trial.
Simply put, in this particular lawsuit, the outcome of the case on the merits and the court process by which the lawsuit was resolved, would almost certainly have been the same in state court as it was in federal court. Indeed, it would it have been the same in any U.S. court of general jurisdiction state or federal.
The underlying rule allowing cases to be brought in federal court on the grounds that there is diversity jurisdiction even in circumstances where both parties to the lawsuit have their principal offices in the same state (in this case California), is stupid and serves no legitimate purpose other than to give national banks more capacity to forum shop than any other kind of person or business. The law interpreted to allow national banks this privilege was likewise unclear at best, in part, because it was adopted before interstate banking was common or even, for the most part, permitted at all. One sensible place to cut the federal budget, albeit by no more than a smigen, would be to greatly narrow the scope of the diversity jurisdiction of the federal courts to cases like this one where it adds complexity without offering any meaninginful benefit to the process or advancing any genuine federalism interest. Indeed, this stupid rule is likely to produce considerably more litigation in the future because there is a conflict between the federal circuits over its meaning, thus enhancing uncertainty rather than limiting it.
But, since national banks are some of the most prolific litigators in the entire court system, and Wells Fargo alone is probably in the top ten most common non-governmental parties in lawsuits in the entire United States, the ruling is notable.