Psalm 23: "1 The LORD is my shepherd; I shall not want. 2 He makes me lie down in green pastures. He leads me beside still waters. 3 He restores my soul. He leads me in paths of righteousness for his name's sake.
"4 Even though I walk through the valley of the shadow of death, I will fear no evil, for you are with me; your rod and your staff, they comfort me.
"5 You prepare a table before me in the presence of my enemies; you anoint my head with oil; my cup overflows. 6 Surely goodness and mercy shall follow me all the days of my life, and I shall dwell in the house of the LORD forever."
Isaiah 40:11: "He will tend his flock like a shepherd; he will gather the lambs in his arms; he will carry them in his bosom, and gently lead those that are with young."
Isaiah 49:10: "they shall not hunger or thirst, neither scorching wind nor sun shall strike them, for he who has pity on them will lead them, and by springs of water will guide them."
John 21:15: "When they had finished breakfast, Jesus said to Simon Peter, 'Simon, son of John, do you love me more than these?' He said to him, 'Yes, Lord; you know that I love you.' He said to him, 'Feed my lambs.'"
+++
The text is public domain:
1 I am Jesus' little lamb,Ever glad at heart I am;For my Shepherd gently guides me,Knows my need and well provides me,Loves me ev'ry day the same,Even calls me by my name.2 Day by day, at home, away,Jesus is my staff and stay.When I hunger, Jesus feeds me,Into pleasant pastures leads me;When I thirst, He bids me goWhere the quiet waters flow.3 Who so happy as I am,Even now the Shepherd's lamb?And when my short life is ended,By His angel host attended,He shall fold me to His breast,There within His arms to rest.
+++
Psalm 23 is the main source for the hymn, and the other citations seem merely to overlap some elements, particularly leading and feeding the sheep.
"Knows my need" in the first verse may come from part of Matthew 6:8 ("'your Father knows what you need before you ask him'") or part of Matthew 6:32 ("'your heavenly Father knows that you need them all'").
+++
I've noted before that the alliteration of "staff and stay" illustrates the order that God maintains over creation for the sake of His sheep. It could also illustrate His steadfastness.
The alliteration in "pleasant pastures" is also significant. The euphony of this alliteration (and the syllabic balance of the two words) mirrors the meaning.