What do state-owned enterprises (SOEs) do? How do they respond to market incentives? Can we expect substantial efficiency gains from trade liberalization in economies with a strong presence of SOEs? Using a new dataset of Vietnamese firms we document a set of empirical regularities distinguishing SOEs from private firms. Then we empirically study the effect of the 2007 WTO accession on selection, competition, and productivity. Our results show that WTO entry is associated with higher probability of exit, lower firm profitability, and substantial increases in productivity for private firms but not for SOEs. Our estimates suggest that the overall productivity gains would have been about 40% larger in a counterfactual Vietnamese economy without SOEs. We highlight some economic mechanisms possibly driving these findings through the lenses of a model of trade with heterogeneous private and state-owned firms. The model suggests that political/regulatory barriers to entry and access to credit are key drivers of the different response of SOEs to trade liberalization. Further empirical tests broadly validate these insights.