When we say subject matter jurisdiction we mean the power of a court to decide a certain type of case. Federal courts in the United States have the power to decide some types of cases but they do not have subject matter jurisdiction over every type of case in the United States.
U.S. federal courts’ subject matter jurisdiction comes from the Constitution and the Congress of the United States. If you look at Article III of the U.S. Constitution you will see a list of cases in which the federal courts have subject matter jurisdiction. These cases include, among other things, admiralty cases, patent cases, and cases between two different states (e.g., New York sues New Jersey).
Keep in mind that some cases can be heard in both state and federal courts. We can say that the federal and state courts have concurrent jurisdiction over those types of cases.
But for some types of cases federal courts have exclusive federal subject matter jurisdiction – – only federal courts can decide these types of cases. In other words, the cases cannot be heard in state court. Some examples where federal courts have exclusive subject matter jurisdiction include the types of cases I listed above as well as bankruptcy cases and federal antitrust cases.
When passing a law, sometimes Congress will specify that federal courts have exclusive subject matter jurisdiction. For example, if you look at 18 USC 2338 and subsequent sections you will see that Congress established certain laws regarding acts of terrorism and that these cases can only be heard in federal courts.