Because Rome was annexed by Italy in 1870, the secular power of the pope declined. His moral influence, however, grew. Several new ideologies criticised the faith and depicted it as unreasonable. In response, the Church developed new ways to explain and demonstrate the reasonableness of faith. For example, the pope encouraged scientific research.
In response to socialism, Pope Leo XIII wrote in a letter (encyclical) that workers and factory owners had to work together to build a better society, and that the state also has a role in this effort. He also called for the creation of Catholic trade unions. This encyclical is regarded as the first formal expression of the social doctrine of the Church.