Under the Insurrection Act, which was signed into law in 1807, a president can deploy troops during what is called an insurrection, simply meaning when all hell breaks loose. The president can decide that it is “impracticable,” according to the Insurrection Act, to enforce the laws of the U.S. in a given city, and he may call forth the military or the National Guard to help restore law and order.
In order to invoke the Insurrection Act, the president first has to make a proclamation to those he calls the insurrectionists to cease and desist. Unless the alleged insurrectionists immediately do what the president says, the president then has the authority to deploy forces.
Trump has repeatedly called the protesters in Los Angeles “insurrectionists,” but has also walked those remarks back and hasn’t made any kind of formal proclamation yet. When Trump ordered California’s National Guard members to deploy to Los Angeles on June 7, he did so on a narrow statutory authority to protect federal buildings, properties and personnel that were trying to enforce immigration laws.