"Such was the Saviour's reception when He came to the earth. There seemed to be no place of rest or safety for the infant Redeemer. God could not trust His beloved Son with men, even while carrying forward His work for their salvation. He commissioned angels to attend Jesus and protect Him till He should accomplish His mission on earth, and die by the hands of those whom He came to save. DA 67.1"
"And when they were departed, behold, the angel of the Lord appeareth to Joseph in a dream, saying, Arise, and take the young child and his mother, and flee into Egypt, and be thou there until I bring thee word: for Herod will seek the young child to destroy him."
Both passages describe the circumstances surrounding Jesus' birth and the threat posed by Herod, leading to the flight to Egypt. The EGW passage emphasizes God's protection through angels, which is directly related to the angel's appearance to Joseph in Matthew.