Now, in this symbolic movement toward the ‘God-fearers’, who were wanting to see Jesus, it shows He is not a person just for the nation of Israel, but for persons of all the world. Christ came to save the whole world, and this message would be available to all who would receive.
So, what we have is an open announcement that He is, in fact, the promised Messiah. I think, in effect, He is forcing the hand of the leaders, and how the Sanhedrin would act during the Passover.
Mary seemed to have a deeper understanding. To some degree it may have been a bit like Caiaphas, who, you recall, made a proclamation that it was necessary for one man to die for the sins of the people.
Now, “Jesus, therefore, six days before the Passover, came to Bethany where Lazarus was, whom Jesus had raised from the dead. So they made Him a supper there and Martha was serving; but Lazarus was one of those reclining at the table with Him. Mary took a pound of very costly perfume of pure nard, and anointed the feet of Jesus and wiped His feet with her hair; and the house was filled with the fragrance of perfume.”