In the infancy narratives of Matthew’s Gospel, the narrator invites the reader to compare the different plans that Joseph and Herod make. Only twice in the Gospel of Matthew does the term lathra (“secretly”) occur (1:19; 2:7), and in juxtaposed stories as well: 1:18-25 and 2:1-12.
Joseph plans to divorce Mary “secretly” (or “quietly”) in Matthew 1:19, because he is a righteous man. But Herod summons the Magi “secretly” in 2:7 in order to find out when the star appeared, because he is an evil man. Furthermore, as the story unfolds in Matthew 2, Herod’s actions aim to murder Jesus while Joseph’s actions aim to protect him.
Both Joseph and Herod have secret plans, but one is righteous and the other wicked.