What Republicans can learn from the Democrats’ revival