47 But Mary anointed the head of our Lord's body, as a token of the better part which she had chosen. And Christ prophesied concerning that which her soul had chosen. While Martha was cumbered with serving, Mary was hungering to be satisfied with spiritual things by Him Who also satisfies us with bodily things. So Mary refreshed Him with precious ointment, as He had refreshed her with His exalted teaching. Mary by the oil showed forth the mystery of His mortality, Who by His teaching mortified the concupiscence of her flesh.
Thus the sinful woman by the flood of her tears, in full assurance was rewarded with remission of sins from beside His feet; and she who had the issue of blood, stole healing from the hem of His garment. But Mary received blessing openly from His mouth, as a reward of the service of her hands upon His head. For she poured out on His head the precious ointment, and received from His mouth a wonderful promise. This is the ointment which was sown above and yielded fruit below. For she sowed it on His head and gathered its fruit from between His lips— She shall have a name and this memorial in every place where My Gospel shall be preached. Accordingly, what she then received of Him, He is able to cause to pass unto all generations: and in no generation can any hinder it.
For the ointment which she poured upon His head, gave its odour in presence of all the guests and refreshed Him; so also the goodly name which He gave her, passes down through all generations and brings honour to her. Even as all who were at the feast were sensible of her ointment; it was meet that all who come into the world should be sensible of her triumph. This is a loan whereof the increase is exacted in all generations.
Source: On Our Lord (New Advent)