Pope Pius XI wrote the encyclical Quadragesimo Anno in 1931 to address the ethical challenges arising from industrialization and the rise of economic systems like capitalism and socialism. He advocated for principles of solidarity and subsidiarity to reconstruct the social order. The encyclical criticized unrestrained capitalism for exploiting workers and called for a social system that respects human dignity and distributes wealth justly. It also discussed the rights of private property, social justice, charity, and the role of civil organizations in society.