 We see a lot of parallels between what's going on in 2 Samuel and what's going on in Luke 1. Luke is clearly referencing the story of David bringing up the ark to Jerusalem, and he's using it to describe Mary.