Sometimes when states fail to prosecute, or fail to get a conviction, the Feds will prosecute. But the original crime might not be a federal crime, so they prosecute under something else (there are ~3000 federal laws to choose from).
For example, sometimes when police kill citizens, and DAs don't prosecute, the Feds will. But the murder isn't in federal jurisdiction, so they charge them with "color of law"[2][3], which is a federal crime.
[1] https://en.wikipedia.org/wiki/Murder_(United_States_law)#Jur...
[2] https://en.wikipedia.org/wiki/Color_(law)
[4] https://www.justice.gov/crt/deprivation-rights-under-color-l...
Fun fact: the federal law that bans firearms in schools is based on "interstate commerce".
> the firearm in question "has moved in or otherwise affects interstate commerce."[3] As nearly all firearms have moved in interstate commerce at some point in their existence, critics assert this was merely a legislative tactic to circumvent the Supreme Court's ruling.[2]