We do not know exactly what Matthew meant by the expression “by the Holy Spirit,” but in contrast to what was said in Matt 1:25 it is clear that the male half of the relationship is excluded from the conception of the child. Someone who read Greek during that time period might imagine the Holy Spirit acting like Zeus or another one of the Greek-Roman gods who took a virgin or a young bride and through a sui generis sexual act begat a child.
In a Jewish environment where the Holy Spirit is none other than God himself as a spirit acting out of his own strength, it seems this is what is implied in the passage from Luke 1:35, i.e., that divine protective shadow of the “Most High,” which replaces the male sperm. The thought of a sexual act would never have crossed the mind of a Jewish person. The shadow is just a sign of the active presence of God. Another example of this is seen in the account of Jesus’ transfiguration:
"While he was saying this, a cloud appeared and overshadowed them. They became afraid as they entered the cloud. Then a voice came from the cloud, saying: 'This is my Son, the Chosen One; listen to him.'" (Luke 9:34–35)