Why are democracies backsliding? I contend that a large productivity gap between economic groups motivates those with low productivity to capture the state for rent-seeking. They assess their relative position as weak and are willing to sacrifice certain democratic guarantees in exchange for favorable policies. Erosion takes two forms. (1) With high inter-class inequality and a large productivity gap among economic industries, losing economic elites capture the state through a political outsider who enacts favorable policy. Once in office, the outsider expands his personal executive control and attacks key democratic veto players. (2) When inter-class inequality is high but the inter-industry productivity gap is small, a united economic elite coordinate to stop a populist takeover. Traditional political elites respond to the populist threat by curtailing basic freedoms of speech and association. I use both quantitative and case study evidence from the US and Spain to support my main hypotheses.