American intelligence agencies have warned of influence operations targeting city halls and statehouses. But what’s in it for Beijing?