From a scholarly perspective the doctrine of the Virgin Birth raises many questions, inasmuch as our earliest 'extant' sources - the Pauline epistles and Gospel of Mark - make no (apparent?) allusions to it.
St. Paul seems to assume that Jesus had an ordinary parentage, which he refers to in passing without a hint of controversy or terrible fascination. Some examples:
"The gospel concerning his Son, who was descended from David according to the flesh and designated Son of God in power according to the Spirit of holiness by his resurrection from the dead, Jesus Christ our Lord" (Romans: 3-4)
Paul doesn't mention Mary or Joseph by name, because he's not writing a biography but rather dispatching
ad hoc letters to churches and thus only mentioning things in passing. In terms of his Davdic lineage "
according to the flesh" comment: I just can't think a knowledgeable first century Jew like him would have said this in reference to maternal lineage, so the surface text seems to insinuate that Jesus was a paternal Davidic descendant through his father.
"But when the time had fully come, God sent forth his Son, born of woman, born under the law" (Galatians 4:4 RSV).
Note nothing about a 'virgin', as the scholar James Dunn opines:
"He [Paul] mentions that Jesus was “born of a woman” (Gal. 4.4), a typical Jewish circumlocution for a human person." (The Theology of Paul the Apostle (p. 183))
The idea that Jesus had a normal human conception as a conequence of sexual relations between his parents, was likewise the belief of a number of early Jewish and gnostic Christian sects, including the Ebionites, Simonians, Cerinthians and Carpocratians.
One of the 'Ebionite' sects are described as follows by the fourth century church father, St. Epiphanius:
For since they wish Jesus to be in reality a man, as I have said before, Christ came in him having descended in the form of a dove and was joined to him (as already we have found among other heresies also), and became the Christ from God above, but Jesus was born from the seed of man and woman.
— Epiphanius of Salamis, Panarion 30.14.4-5
And Eusebius too:
The ancients quite properly called these men Ebionites, because they held poor and mean opinions concerning Christ. For they considered him a plain and common man, who was justified only because of his superior virtue, and who was the fruit of the intercourse of a man with Mary. In their opinion the observance of the ceremonial law was altogether necessary, on the ground that they could not be saved by faith in Christ alone and by a corresponding life.
There were others, however, besides them, that were of the same name, but avoided the strange and absurd beliefs of the former, and did not deny that the Lord was born of a virgin and of the Holy Spirit. But nevertheless, inasmuch as they also refused to acknowledge that he pre-existed, being God, Word, and Wisdom, they turned aside into the impiety of the former, especially when they, like them, endeavored to observe strictly the bodily worship of the law.
The Sabbath and the rest of the discipline of the Jews they observed just like them, but at the same time, like us, they celebrated the Lord’s days as a memorial of the resurrection of the Saviour.
—
Eusebius, Ecclesiastical History, Chp. 27
The Cerinthians, a first century Gnosticizing Judaic-chialist sect of early Christianity, likewise rejected the virgin birth narrative:
Cerinthus from the McClintock and Strong Biblical Cyclopedia.
Cerinthus (Κήρινθος), a heresiarch, who lived in the time of the apostle John, towards the end of the first and at the beginning of the second century. The accounts of the ancients and the opinions of modern writers are equally at variance with respect to him. He was a Jew by nation and religion, who, after having studied in the schools of Alexandria, appeared in Palestine, and spread his errors chiefly in Asia Minor. Our sources of information as to his doctrines are Irenaeus, adv. Haer. 1:26; Eusebius, Hist. Eccl. 3:28; 7:25; Epiphanius, Haer. 28; and Theodoret, Fab. Haer. 2:3 (Opp. tom. 3)...
Irenaeus says, 'Cerinthus taught that the world was not made by the supreme God, but by a certain power (Demiurge) separate from Him, and below Him, and ignorant of Him. Jesus he supposed not to be born of a virgin, but to be the son of Joseph and Mary, born altogether as other men are; but he excelled all men in virtue, knowledge, and wisdom.
At His baptism, the Christ came down upon Him, from God who is over all, in the shape of a dove; and then He declared to the world the unknown Father, and wrought miracles. At the end, the Christ left Jesus, and Jesus suffered and rose again, but the Christ, being spiritual, was impassible.'
Epiphanius says nearly the same, but asserts that Cerinthus taught that the world was made by angels, and that he opposed the apostles in Judaea. It appears that Cerinthus considered Christ an ordinary man, born in the usual way, and devoid of miraculous powers, but distinguished from the rest of the Jews by possessing superior wisdom, so that He was worthy to be chosen as the Messiah; that he knew nothing of his high dignity till it was revealed to Him in His baptism by John, when He was consecrated to the Messiahship, and furnished with the necessary powers for the fulfillment of His office by the descent of the supreme Logos or Spirit from the heavens, which hung over Him like a dove, and at length entered into His heart; that He was then raised to the dignity of the Son of God, began to perform miracles, and even angels were now taught by His revelations; that redemption could not be effected by His sufferings. Jesus, in union with the mighty Spirit of God, could not suffer, but must triumph over all His enemies.
The very fact of suffering was assumled to be a proof that the Spirit of God, which had been previously united to Him, was now separated from Him, and had returned to the Father. The sufferings were of the man Jesus, now left to himself. Cerinthus denied also the resurrection of Christ. He adhered in part to Judaism, and considered the Mosaic law binding on Christians. He taught that the righteous would enjoy a paradise of delights in Palestine, and that the man Jesus, through the power of the Logos again coming upon him, as the Messiah, would reign a thousand years" (Farrar, Ecclesiastes Dict. s.v.).
It is supposed that Cerinthus and his doctrines are alluded to in John's Gospel. The system of Cerinthus seems to combine Ebionitism with Gnosticism, and the Judaeo-Christian millenarianism
I'm not really clear in my mind where Matthew and Luke derived the virgin birth doctrine from. And the differences between them make it improbable that either was derived from the other, or that they shared a common written source.
Nevertheless, they both attest to the doctrine seemingly '
independently' - so I presume it must have been based on an earlier oral tradition circulating in the early church communities.
So, we have two independent witnesses to the Virgin birth but which totally diverge about almost everything else concerning it. As such, I think they both heard about the tradition that had been passed down in respect of a virginal conception and birth, and then wrote their own frame stories based on the scant information.