St. Thomas Aquinas from The Summa
Thus, it is impossible that the whole of the effect of predestination in general should have any cause as coming from us; because whatsoever is in man disposing him towards salvation, is all included under the effect of predestination; even the preparation for grace. For neither does this happen otherwise than by divine help, according to the prophet Jeremias (Lam. 5:21): "convert us, O Lord, to Thee, and we shall be converted." Yet predestination has in this way, in regard to its effect, the goodness of God for its reason; towards which the whole effect of predestination is directed as to an end; and from which it proceeds, as from its first moving principle.
I answer that, Predestination most certainly and infallibly takes effect; yet it does not impose any necessity, so that, namely, its effect should take place from necessity. For it was said above (1), that predestination is a part of providence. But not all things subject to providence are necessary; some things happening from contingency, according to the nature of the proximate causes, which divine providence has ordained for such effects. Yet the order of providence is infallible, as was shown above (22, 4). So also the order of predestination is certain; yet free-will is not destroyed; whence the effect of predestination has its contingency. Moreover all that has been said about the divine knowledge and will (14, 13; 19, 4) must also be taken into consideration; since they do not destroy contingency in things, although they themselves are most certain and infallible.
It is not exactly the same thing in the case of the number of the reprobate, who would seem to be pre-ordained by God for the good of the elect, in whose regard "all things work together unto good" (Rm. 8:28). Concerning the number of all the predestined, some say that so many men will be saved as angels fell; some, so many as there were angels left; others, as many as the number of angels created by God. It is, however, better to say that, "to God alone is known the number for whom is reserved eternal happiness [From the 'secret' prayer of the missal, 'pro vivis et defunctis.']"
I answer that, Concerning this question, there were different errors. Some, regarding the certainty of divine predestination, said that prayers were superfluous, as also anything else done to attain salvation; because whether these things were done or not, the predestined would attain, and the reprobate would not attain, eternal salvation. But against this opinion are all the warnings of Holy Scripture, exhorting us to prayer and other good works.
Others declared that the divine predestination was altered through prayer. This is stated to have the opinion of the Egyptians, who thought that the divine ordination, which they called fate, could be frustrated by certain sacrifices and prayers. Against this also is the authority of Scripture. For it is said: "But the triumpher in Israel will not spare and will not be moved to repentance" (1 Kgs. 15:29); and that "the gifts and the calling of God are without repentance" (Rm. 11:29).
Wherefore we must say otherwise that in predestination two things are to be considered--namely, the divine ordination; and its effect. As regards the former, in no possible way can predestination be furthered by the prayers of the saints. For it is not due to their prayers that anyone is predestined by God. As regards the latter, predestination is said to be helped by the prayers of the saints, and by other good works; because providence, of which predestination is a part, does not do away with secondary causes but so provides effects, that the order of secondary causes falls also under providence. So, as natural effects are provided by God in such a way that natural causes are directed to bring about those natural effects, without which those effects would not happen; so the salvation of a person is predestined by God in such a way, that whatever helps that person towards salvation falls under the order of predestination; whether it be one's own prayers or those of another; or other good works, and such like, without which one would not attain to salvation. Whence, the predestined must strive after good works and prayer; because through these means predestination is most certainly fulfilled. For this reason it is said: "Labor more that by good works you may make sure your calling and election" (2 Pt. 1:10).