mid-14c., refreinen, transitive, "exercise control over, restrain; hold (someone or something) back from action," senses now obsolete, also "exercise control over" (thoughts, desires, feelings, vices, etc.); from Old French refraigner, refrener, refreiner "restrain, repress, keep in check" (12c., Modern French réfréner).
This is from Latin refrenare "to bridle, hold in with a bit, check, curb, keep down, control," from re- "back" (see re-) + frenare "restrain, furnish with a bridle," from frenum "a bridle," a word of uncertain etymology (de Vaan supports a theory that it is connected to fretus "relying on").
The classical spelling was restored in French but not in English. In Middle English chiefly transitive. Intransitive sense of "forbear, keep oneself (from)" is from mid-15c. Reflexive sense of "control oneself, put restraint upon oneself" is from late 14c. Related: Refrained; refraining.
"regularly recurring phrase in a poem, chorus, or song," late 14c., refreine, from Old French refrain "chorus" (13c.), an alteration of refrait, a noun use of the past participle of refraindre "to repeat," also "to break off," from Vulgar Latin *refrangere "break off," alteration of Latin refringere "break up, break open" (see refraction) by influence of frangere "to break."
The word was further influenced in French by cognate Provençal refranhar "singing of birds, refrain." The notion is of something that causes a song to "break off" then resume. OED says not common before 19c. For "act of refraining," refraining (mid-14c.) and refrainment (1711) have been used.