One common explanation for the divergence is that Matthew is recording the actual legal genealogy of Jesus through Joseph, according to Jewish custom, whereas Luke, writing for a Gentile audience, gives the actual biological genealogy of Jesus through Mary.