Herod himself had ordered his soldiers to arrest John and put him in prison. Herod did this to please his wife Herodias. She had been married to Herod’s brother Philip, but then Herod married her.
Before this time, Herod had arrested John. He had him chained and put in prison. He arrested John because of Herodias, the wife of Philip, Herod’s brother.
So there were fourteen generations from Abraham to David. There were also fourteen generations from David until the people were taken away to Babylon. And there were fourteen more from the time the people were taken to Babylon until the Messiah was born.