This passage is about the death of John the Baptist, but it is worked into the narrative as back-story to explain why Herod is freaked out when he hears about Jesus' miracles. Herod harbors a guilty conscience for murdering John, and now he thinks God is judging him by bringing John back from the dead in the person of Jesus. We learn from this back-story that Herod feels guilty and paranoid because he executed John against his own conscience, and we also find out how he got cornered into doing it.
Herod had John arrested because John was saying that Herod's marriage to Herodias, the wife of his brother, was unlawful. Herod comes off as a spineless man, hesitant to do this, afraid to do that, wondering what people would think if he went ahead with this. He didn't put John to death because he feared the opinion of the people who regarded John as a prophet. It's a wonder he had the guts to arrest John in the first place, which makes you wonder if Herodias was really the one behind it. She knew that her husband was a weak man, and probably it was she who insisted upon John's arrest. Then when Herod hesitated to execute John, she looked for an opportunity to force his hand.
It was Herod's birthday. The wine was flowing, the dinner guests were laughing, the entertainment abounded. Herodias's daughter came and danced before the guests, probably not very modestly dressed, and Herod, feeling drunk and lustful and big-hearted, promised upon oath to give her whatever she wanted. He could afford to be generous; the girl would probably ask for some pretty or extravagant thing. But she asked for the head of John the Baptist and he was taken off guard. This was Herodias's demand, the girl herself would never think to make such a request. Yet he had promised his step-daughter before all these guests; he was caught. So he gave the order, impulsively, to maintain the good cheer of the dinner party, but inside he was grieved, knowing he would regret this once he was fully sober in the morning.
In the movies heroes die heroic deaths. They die in furious battles. They are assassinated by dangerous foes. They stay behind in collapsing buildings or exploding spaceships while the people they saved escape. But John the Baptist died a degrading, humiliating death. Sure, he was arrested for taking a stand of righteousness against Herod's unlawful marriage, but in the end he was done in by Herod's cowardice and the treachery of a teenage girl and her mother. Herod killed John almost on a whim: he made a rash oath, then he gave John's order of execution to save face. Doesn't a holy man, a prophet of God, deserve a better fate than that? At least have him die at the edge of a sword, at the hand of a formidable enemy in the midst of some valiant struggle. How could John die because a half-drunk king was tricked by his wife and enticed by his own step-daughter, so that John's head would end up being paraded around on a platter at a birthday party before laughing guests?
Welcome to the kingdom of God. Glory is for heaven, but on earth nothing is guaranteed. You might imagine that at the end of your life you will meet death in a dignified manner, lying in your bed at home surrounded by family and friends; but then again you might not. You might die alone and forgotten in a nursing home. You might die in the mud underneath an overturned car. I once read of a Christian missionary who not only met his death in prison, but it was from accidental electrocution while he was seated on a metal toilet seat. How would you like that story included in your missionary biography? Jesus himself died a humiliating death, stripped naked and pinned to a cross on public display, like some insect in a lepidopterist's collection. All of us who follow Jesus follow in that path. There is no guarantee that our ideas about dignity or pleasant storybook endings for ourselves will come to fruition, as the story of John the Baptist well illustrates.