We talk about this in the second book of the Hooktheory Book Series. The borrowed iv is explained in section 6.3. Here is excerpt from the explanation in the book. Hope it helps!
The borrowed iv turns out to have a very specific function. It almost always appears at the end of a progression as a cadence chord going to I. Listen to how it’s used in the song “Wake Me Up When September Ends” by Green Day. Note that in this and all other examples in the book, we label the mode that a chord is borrowed from in parentheses below its name:
As soon as we hear the iv, our ears know what they want to hear next. This tendency as a cadence chord can be explained by the proximity and pull that the individual scale degrees contained in iv have to the scale degrees contained in I. Scale degrees 4 and ♭6 of the iv chord both lie one note (a “half-step”) above scale degrees 3 and 5 of the I chord. This creates a gravity that tends to want to pull them down. The ♭6, in particular, has extra tension and pull due to its position outside the major scale. Resolving this note downward by step provides the relief our ears are looking for. Lastly, the other note in iv, scale degree 1, happens to also be contained in I, conveniently allowing this scale degree to be held as a common note during the change.
Borrowed iv chords show up over and over again in popular music, and it’s almost always in this context. IV → iv (borrowed from minor) → I is a great alternative way to cadence in style. “Jar of Hearts” by Christina Perri is another song that uses borrowed iv chords in this same way: