Theory:

Refrain is a type of repetition found in poetry. In this type of repetition, a phrase, a line, or lines are repeated instead of a word.
Pronunciation Guide
Refrain-- re (as in "remember")-- fra (as in "phrase")-- in (as in "pain")
In a refrain, a line can be repeated either with lines in between or not. Let us take the following poem by David Bates as an example:
Example:
Speak gently! – It is better far
     To rule by love, than fear
Speak gently– let not harsh words mar
     The good we might do here!
 
Speak gently! – Love doth whisper low
     The vows that true hearts bind;
And gently Friendship’s accents flow;
     Affection’s voice is kind.
 
Speak gently to the little child!
     Its love be sure to gain;
Teach it in accents soft and mild:-
     It may not long remain.
 
Speak gently to the young, for they
     Will have enough to bear –
Pass through this life as best they may,
     ‘T is full of anxious care!

Speak gently to the aged one,
       Grieve not the care-worn heart;
The sands of life are nearly run,
      Let such in peace depart!
 
Speak gently, kindly, to the poor;
      Let no harsh tone be heard;
They have enough they must endure,
     Without an unkind word!
 
Speak gently to the erring – know,
     They may have toiled in vain;
Perchance unkindness made them so;
     Oh, win them back again!
 
Speak gently! – He who gave his life
     To bend man’s stubborn will,
When elements were in fierce strife,
     Said to them, ‘Peace, be still.’
 
Speak gently! – ’tis a little thing
     Dropped in the heart’s deep well;
The good, the joy, which it may bring,
     Eternity shall tell.
"Speak gently" is the refrain in the poem. It is repeated constantly throughout the poem, with intervals (or lines in between).
 
Refrain can appear anywhere in the poem, with or without the intervals. It can appear at the beginning of the stanzas like the above example. It can also appear at the end, like the one seen in the poem "Stopping by Woods on a Snowy Evening" by Robert Frost.
Example:
Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.
 
My little horse must think it queer
To stop without a farmhouse near
Between the woods and frozen lake
The darkest evening of the year.
 
He gives his harness bells a shake
To ask if there is some mistake.
The only other sound’s the sweep
Of easy wind and downy flake.
 
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.
The above poem is also an example to show that the lines can be repeated immediately without intervals.
According to J.A.Cuddon, refrain is "a phrase, line or lines repeated at intervals during a poem and especially at the end of a stanza". 'Very often it is an exact repetition but sometimes it will undergo a slight modification'.
As Cuddon pointed out, refrain can also happen with modification. Let us take the following poem "Disdain me Not" by  Sir Thomas Wyatt as an example:
Example:
Disdain me not without desert,
Nor leave me not so suddenly;
Since well ye wot that in my heart
I mean ye not but honestly.
Disdain me not.
 
Refuse me not without cause why,
Nor think me not to be unjust;
Since that by lot of fantasy
This careful knot needs knit I must.
Refuse me not.
 
Mistrust me not, though some there be
That fain would spot my steadfastness;
Believe them not, since that we see
The proof is not as they express.
Mistrust me not.
 
Forsake me not till I deserve
Nor hate me not till I offend;
Destroy me not till that I swerve;
But since ye know that I intend,
Forsake me not.
 
Disdain me not that I'm your own:
Refuse me not that I'm so true:
Mistrust me not till all be known:
Forsake me not ne for no new.
Disdain me not.
The above contains several other types of repetitions as well. However, what is to be noted here is that this poem contains two sets of refrains.
 
The first set of refrains can be seen in the individual stanzas. Each stanza has a refrain that appears in the beginning and the end. For example, the second stanza contains the refrain "refuse me not" at the beginning and in the end.
 
The second set can be seen in the poem as a whole. Throughout the poem, the phrase "disdain me not" is repeated with modification. Words such as refuse, mistrust, and forsake are used as modifications here.
Hence, if a line or a phrase is repeated, it is called a refrain.
Refrain used in the poem "The Shed":
There’s a shed at the bottom of our garden
With a spider’s web hanging across the door,
The hinges are rusty and creak in the wind.
When I’m in bed I lie and I listen,
I’ll open that door one day.
 
There’s a dusty old window around at the side
With three cracked panes of glass,
I often think there’s someone staring at me
Each time that I pass,
I’ll peep through that window one day.
 
My brother says there’s a ghost in the shed
Who hides under the rotten floorboards,
And if I ever dare to set foot inside
He’ll jump out and chop off my head,
But I’ll take a peek one day.
 
I know that there isn’t really a ghost,
My brother tells lies to keep the shed for his den;
There isn’t anyone staring or making strange noises
And the spider has been gone from his web
since I don’t know when,
I’ll go into that shed one day soon,
 
But not just yet...
 
Important!
The lines "I’ll open that door one day", "I’ll peep through that window one day", "I’ll take a peek one day", and "I’ll go into that shed one day" are repeated with modifications. It is interesting to note how all the highlighted lines begin with the word "I'll" and ends with "one day"; on the other hand, the words in the middle are modified, yet they present the same idea (that the 'speaker wishes to visit the shed"). Hence, this is an example of a refrain.
Reference:
  • State Council of Educational Research and Training (2019). Term-1 English Standard-7. Your Space by David Bates (pp. 70-72). Published by the Tamil Nadu Textbook and Educational Services Corporation.
  • https://www.poetryfoundation.org/poems/42891/stopping-by-woods-on-a-snowy-evening
  • https://allpoetry.com/Disdain-Me-Not
  • Cuddon, J.A. A Dictionary of Literary Terms and Literary Theory. West Sussex, Wiley-Blackwell Publication, 2013.
  • National Council of Educational Research and Training (2007). Honeycomb. The Shed: Frank Flynn (pp. 48 -49). Published at the Publication Division by the Secretary, National Council of Educational Research and Training, Sri Aurobindo Marg, New Delhi.