The woman who anoints Jesus with oil in Matthew seems to be Mary of Bethany,if we agree that Matthew, Mark and John are speaking of the same event. Luke’s similar story has enough differences of place, time and details to indicate that it was a different story. (Mark 14:3-9; John 12:1-8; Luke 7:37-39)
This comes at the start of the Passion Narrative, where one event flows into the next in rapid fire succession. Matthew, however seems to continue his collecting method; the chronology of the event may not have happened right then. So then we wonder what is the thematic link.
Mary gives an extremely valuable gift, so much so that there is opposition to it. she breaks open a vial of aromatic oil and pours it out completely on Jesus head (Matthew) and feet (Mark, John). It is an act of devotion from a disciple who expresses love. Jesus points out that it is preparation for his death and burial. He has been talking about that since Peter’s confession
Jesus, at the Passover meal, institutes the Lord’s supper. He breaks bread and pours out the wine. There is also opposition, all around this act, there are the machinations of the religious leaders and of Judas. Jesus gives his most precious gift (his life) symbolized in every day food (bread and wine).
Are we to see these two acts of devotion together? Broken, poured out, forgiven, love, complete, death.
Mary acted first in the narrative, but the grace of the Lord preceded any act that she offered.