you were the one: In the ancient world, a covenant relationship was sometimes formed between a ruler and the people who served him. Scholars often call this a suzerain–vassal treaty (an agreement between a powerful ruler and weaker subjects). This kind of relationship often began because the ruler had helped the people in the past, especially by rescuing them from enemies. Examples include:
Gideon (see Judges 8:22),
Jephthah (Judges 11:8–11), and
Saul (1 Samuel 11:1–15).
This political practice helps explain the covenant idea in Scripture. God was Israel’s covenant Lord because he had rescued them from slavery in Egypt (compare Exodus 19:4; 20:1–2).
to you the LORD said: Israel already knew that God had chosen David as king (compare 2 Samuel 3:9).
You will shepherd My people Israel: This phrase is quoted in Matthew 2:6 when King Herod asks the leading priests about the prophecies concerning the Messiah (God's chosen one).