It’s a question many ask, and one which John Calvin addresses well in his commentary on Matthew:
The Spirit of God, who had appointed the Evangelists to be his clerks, appears purposely to have regulated their style in such a manner, that they all wrote one and the same history, with the most perfect agreement, but in different ways. It was intended, that the truth of God should more clearly and strikingly appear, when it was manifest that his witnesses did not speak by a preconcerted plan, but that each of them separately, without paying any attention to another, wrote freely and honestly what the Holy Spirit dictated.
Cf. John Calvin and William Pringle, Commentary on a Harmony of the Evangelists Matthew, Mark, and Luke, vol. 1 (Bellingham, WA: Logos Bible Software, 2010), 127.