How democratic institutions make countries wealthier