Democrats made history with state-level gains. That could be crucial for democracy