system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5 the different kinds of U.S. law enforcement

There's U.S. Marshals, state police, county police, DSS agents, Secret Service, FBI, CIA, military, etc. What is the hierarchy here and what is the jurisdiction of each kind?
gpt
Jurisdiction is limited to what types of laws an agency can enforce as well as where they can enforce those laws. The military, for instance, cannot generally exercise police powers in the United States (there are exceptions). The CIA is not a law enforcement agency, and cannot go around arresting people. The FBI is the general law enforcement agency of the federal government, and they CAN investigate any crime under federal law. However, practically every agency has its own police force to investigate crimes falling under that agency's mandate. For example, the Postal Service has police that will investigate crimes involving the mail. Thus the FBI will not investigate mail crimes. They could if they wanted, but for the most part will leave the other federal agencies to their own devices.

The Secret Service sticks to investigating counterfeiting and threats against the President as well as patrolling the White House. The Supreme Court Police patrol the Supreme Court building. The Diplomatic Security Service act as bodyguards for foreign officials. The US Marshals are primarily tasked with enforcing orders of the federal courts, which includes tracking down and arresting people with outstanding warrants and seizing property. They also provide security at federal courthouses. The Federal Protective Service patrols federal buildings and acts as security.

However, general police powers are reserved to the states. That's why the FBI won't pull you over for speeding. The states have their own levels of law enforcement, starting with the statewide police force which may be referred to as state troopers, highway patrol, state police, or some other variant. They can enforce any state law throughout the state, but are typically confined to rural areas and highways. That's because there are county and municipal police forces.

County police forces are the sheriffs - typically elected officials. They will hire a number of deputies and are usually responsible for providing a county jail. They can enforce state laws throughout the entire county, but with an emphasis on areas of the county that fall outside a city limits. That's because cities have their own police force. The city police force will enforce state laws within the city limits. 

Now, state laws are the laws we are most familiar with. These are things such as speeding, murder, assault, domestic violence, possession of drugs, theft, etc. There are many cases where federal and state laws overlap. 

A city police officer may arrest somebody for having cocaine under a state law. However, it's found out that this guy is a major drug dealer. So the federal police go ahead and charge him with a federal crime relating to drugs. In this instance, the federal law will override the state law and the state charge will be dismissed. He will be arrested by the federal police and have to go to federal court for the offense.

Basically, each agency is tasked with investigating certain types of crimes. They will give preference to those types of crimes. The only rule being that federal police can only enforce federal laws and state/county/city police can only enforce state laws (for the most part).