The chief priests and the religion lawyers plotted to kill Jesus. They had rejected the witness of their own eyes as to Jesus’ miracles, and were just all caught up in that Jesus’ teachings exposed them.
A woman anoints Jesus with nard, an expensive oil-based perfume, and some disciples were upset at the “waste” but Jesus said that wherever the Good News is preached, she would be remembered for what she did, because she was preparing him for his burial. Jesus knew that the plot to kill him would succeed. In his Gospel account, John tells us that this woman was Mary the sister of Martha & Lazarus.
Jesus very explicitly again affirms that he is going to die, and that they would be scattered. He predicts Peter would deny him, in spite of his bravado.
Judas may have gone to betray Jesus because he knew Jesus could do miracles, and was the Messiah, yet seemed to refuse to take political power. Judas might have been trying to force Jesus’ hand.
Even to the “good” disciples, Jesus’ upcoming death seemed nonsensical and a disaster, but God had a good plan behind it.
Application: when God doesn’t seem to make sense, when things seem to be going crazy, we can still rest assured He is still in control.