The national guard is normally used in disaster relief, like floods. But the Governor is like a tiny president, (sorta, kinda) and as such has some powers over the military force from their state (hand waving a lot here).
As such they can declare a protest or other interior event a “disaster” or public safety risk, and temporarily deploy national guard to support.
If I remember correctly, the guard have to abide by additional federal military rules, compared to state employees, so they are usually carefully used. and again I might be wrong but if the state deploys em, the state pays em,… Not the federal government