The Catholic Church thinks miracles are functions of God, both immediately, or with the prayers and intercessions of a particular saint or saints. There is generally a selected reason connected to a wonder, e.g. the conversion of somebody or persons on the Catholic religion or the development of the church https://livingchurchministries.org/jesus.htm