There are many ways to borrow from other keys. The most common way and the one I will deal here with here because anything else would require writing a book, is parallel keys that have the same route as was referenced before. But the reference does not have to be to the route it can be to any chord in a progression that matches the root of a parallel key. The matching is a pivot point. And example might be playing C, in C Major, to an F minor to a Bb dominant resolving to a C. The F is the pivot chord since the F root exists in both the key of C and the key of Eb; but, we change the quality. The chord Bb7 does not exist in the key of C and is being used as a what is called a backdoor dominant because it shares three notes (D,F,Ab) with the diminished chord which substitutes for the G7. If resolved correctly, the Bb note would resolve as a #9.
The point is that you are not required to commit to the entire parallel key to borrow from it.
Ellynne P.
This is an interesting question. I come from a jazz background. Often chord substitutions are used. The most common substitution is the tritone sub, used for smoother bass voice leading. It is my experience that you can change chords in a composition (reharmonize) as long as the new harmonies replace the same function of the original chords. Often borrowing from outside the key is commonly done in jazz. Secondary dominants and the V of V (described above) are used often in jazz.02/13/21