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 "Macavity: The Mystery Cat":
Macavity’s a Mystery Cat: he’s called the Hidden Paw —
For he’s the master criminal who can defy the Law.
He’s the bafflement of Scotland Yard, the Flying Squad’s despair:
For when they reach the scene of crime — Macavity’s not there!
 
Macavity, Macavity, there’s no one like Macavity,
He’s broken every human law, he breaks the law of gravity.
His powers of levitation would make a fakir stare,
And when you reach the scene of crime — Macavity’s not there!
You may seek him in the basement, you may look up in the air —
But I tell you once and once again, Macavity’s not there!
 
Macavity’s a ginger cat, he’s very tall and thin;
You would know him if you saw him, for his eyes are sunken in.
His brow is deeply lined with thought, his head is highly domed;
His coat is dusty from neglect, his whiskers are uncombed.
He sways his head from side to side, with movements like a snake;
And when you think he’s half asleep, he’s always wide awake.
 
Macavity, Macavity, there’s no one like Macavity,
For he’s a fiend in feline shape, a monster of depravity.
You may meet him in a by-street, you may see him in the square —
But when a crime’s discovered, then Macavity’s not there!
 
Important!
There are two sets of refrain in the poem: "Macavity’s not there!" and "Macavity, Macavity, there’s no one like Macavity".
    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.