14 King Herod heard of it, for Jesus' name had become known. Some said, “John the Baptist has been raised from the dead. That is why these miraculous powers are at work in him.” 15 But others said, “He is Elijah.” And others said, “He is a prophet, like one of the prophets of old.” 16 But when Herod heard of it, he said, “John, whom I beheaded, has been raised.” 17 For it was Herod who had sent and seized John and bound him in prison for the sake of Herodias, his brother Philip's wife, because he had married her. 18 For John had been saying to Herod, “It is not lawful for you to have your brother's wife.” 19 And Herodias had a grudge against him and wanted to put him to death. But she could not, 20 for Herod feared John, knowing that he was a righteous and holy man, and he kept him safe. When he heard him, he was greatly perplexed, and yet he heard him gladly.
21 But an opportunity came when Herod on his birthday gave a banquet for his nobles and military commanders and the leading men of Galilee. 22 For when Herodias's daughter came in and danced, she pleased Herod and his guests. And the king said to the girl, “Ask me for whatever you wish, and I will give it to you.” 23 And he vowed to her, “Whatever you ask me, I will give you, up to half of my kingdom.” 24 And she went out and said to her mother, “For what should I ask?” And she said, “The head of John the Baptist.” 25 And she came in immediately with haste to the king and asked, saying, “I want you to give me at once the head of John the Baptist on a platter.” 26 And the king was exceedingly sorry, but because of his oaths and his guests he did not want to break his word to her. 27 And immediately the king sent an executioner with orders to bring John's head. He went and beheaded him in the prison 28 and brought his head on a platter and gave it to the girl, and the girl gave it to her mother. 29 When his disciples heard of it, they came and took his body and laid it in a tomb.
This is the ESV interpretation of this passage. It appears that this little excerpt is about Herod and his reaction to hearing about Jesus. It caused Herod to reflect on his beheading of John the Baptist and wonder just who Jesus really is. The purpose of the story is to inform us of John's fate as well as to show another perspective about what the people thought about Jesus.