Christ sent his apostles in groups of two to different villages with authority to cast out demons. "They drove out many demons, and they anointed with oil many who were sick and cured them. (Mk 6:13) Likewise we are told by St. James who was not an apostle but a relative of Jesus called "brother of the Lord", the leader of the Jewish Christian community in Jerusalem as follows: "Is anyone one among you sick? He should summon the presbyters of the Church, and they should pray over him and anoint [him] with oil in the name of the Lord, and the prayer of faith will save the sick person, and the Lord will raise him up. If he has committed any sins, he will be forgiven." (Jas 5:14-15) This indicates that Christ's healing power was passed on to the Apostles.
On the other hand, one day the Apostles the apostles tried to prevent a man from driving out demons in the name of Christ because he was not of their company. Jesus told them, "Do not prevent him. There is no one who performs a mighty deed in my name who can at the same time speak ill of me. For whoever is not against us is for us." (Mk 9:39-40) This is healing taking place outside the sphere of those entrusted by Christ with power to heal by His direct presence and activity.
Christ then, is the origin of the sacred sign called "Anointing of the Sick". The purpose of the sacrament is to bring the suffering of the individual into union with the sufferings of Christ thus strengthening the spirit/soul and sometimes restoring the Christian to bodily health if in God's wisdom it is beneficial for his spiritual salvation. Physical healing is not produced in a miraculous manner but as a consequence of the strengthening of the soul. As such, it presupposes the possibility of "natural healing" remembering that nature or the potentialities inherent in nature are also produced by God who sustains the universe by his mighty power.
As time passed, the power of the Church to heal became restricted to those at the point of death and became known as "Extreme Unction". This was due to misunderstanding and other historical factors. Today, the Church encourages the "Anointing of the sick" to any seriously sick person due to sickness or old age. We read in Catechism, "It is fitting to receive the anointing of the sick just prior to a serious operation. The same hold true for the elderly whose frailty becomes more pronounced." (Cath of Cath. Church #1515)