In Matthew chapter 1, verse 17 states that the preceding genealogy (Matthew 1:1-16) counts three groups of 14 generations:
Matthew 1:17
17 So all the generations from Abraham to David are fourteen generations; and from David until the carrying away into Babylon are fourteen generations; and from the carrying away into Babylon unto Christ are fourteen generations.
However, there are ways of counting that would land someone at 13, or even 15 generations in the various blocks, and this leads to verse 17 being included in contradiction lists.
There are a few ways to resolve this. First, the last generation of each block is also considered the first generation in the next block. So, we'd have:
You'll notice that Jeconiah is crossed out in the middle block, because his seed was cursed, and it was prophesied "no man of his seed shall prosper, sitting upon the throne of David" (Jeremiah 22:30). Of course, Jesus was not the "seed" of Joseph. Giving Joseph's genealogy here is to establish the fact that Jesus is descended from David on both sides - both legally (Joseph, descended from David's son Solomon - Matthew 1:6) and physically (Mary, descended from David's son Nathan - Luke 3:31).
We could also arrive at 14 in that block if we didn't count David as the start of it, but I think that Jechoniah is mentioned on purpose, and then also purposely not counted in Matthew 1:17, to hearken back to the fact that he got his family cursed.
Likewise, if the genealogy ends with Joseph, instead of Jesus, then Jechoniah would be counted, and follow Josias, who still begin the second block.
Either way, the number 14 doesn't have any obvious meaning beyond a memory device. There are lots of names purposely omitted from the genealogy. Between Joram and Ozias, 3 people - Ahaziah, Joash and Amaziah - are omitted. Jehoiakim is omitted between Josias and Jeconias. "Begat", as covered in this article, just means a familial relationship, not strictly father-son.