Romans 8:14-17: "14 For all who are led by the Spirit of God are sons of God. 15 For you did not receive the spirit of slavery to fall back into fear, but you have received the Spirit of adoption as sons, by whom we cry, 'Abba! Father!' 16 The Spirit himself bears witness with our spirit that we are children of God, 17 and if children, then heirs - heirs of God and fellow heirs with Christ, provided we suffer with him in order that we may also be glorified with him."
Romans 8:35-39: "35 Who shall separate us from the love of Christ? Shall tribulation, or distress, or persecution, or famine, or nakedness, or danger, or sword? 36 As it is written, 'For your sake we are being killed all the day long; we are regarded as sheep to be slaughtered.' 37 No, in all these things we are more than conquerors through him who loved us. 38 For I am sure that neither death nor life, nor angels nor rulers, nor things present nor things to come, nor powers, 39 nor height nor depth, nor anything else in all creation, will be able to separate us from the love of God in Christ Jesus our Lord."
Matthew 6:26-27: "26 'Look at the birds of the air: they neither sow nor reap nor gather into barns, and yet your heavenly Father feeds them. Are you not of more value than they? 27 And which of you by being anxious can add a single hour to his span of life?'"
Ephesians 5:25-27: "25 Husbands, love your wives, as Christ loved the church and gave himself up for her, 26 that he might sanctify her, having cleansed her by the washing of water with the word, 27 so that he might present the church to himself in splendor, without spot or wrinkle or any such thing, that she might be holy and without blemish."
+++
The first passage from Romans 8 (verses 14-17) is the main source for the hymn and is referred to throughout.
The passage from Matthew 6 is cited apparently for the bird imagery at the end of the hymn's first verse ("Nestling bird nor star in heaven / Such a refuge e'er was given"), but these lines in the hymn also resemble part of Luke 13:34 ("... 'How often would I have gathered your children together as a hen gathers her brood under her wings...'") and Psalm 91:4 ("He will cover you with his pinions, and under his wings you will find refuge; his faithfulness is a shield and buckler."). Descriptions of God's protection continue in the hymn's second verse.
The second passage from Romans 8 (verses 35-39) appears at the beginning of the hymn's third verse ("Neither life nor death shall ever / From the Lord His children sever"), and the passage from Ephesians 5 is referred to at the end of the fourth verse, which says that God's "loving purpose" is "To preserve them pure and holy."
+++
The beginning of the fourth verse ("Though He giveth or He taketh") is patterned on part of Job 1:21: "And he said, 'Naked I came from my mother's womb, and naked shall I return. The LORD gave, and the LORD has taken away; blessed be the name of the LORD.'"