Modulation & borrowed chords — a brief look ahead
Sometimes a chord appears mid-song that doesn't belong to the key and works anyway. Or the song shifts into a higher key toward the end and sounds brighter for it.
The first is called a borrowed chord: a chord taken from a related key, used deliberately. It works precisely because the ear knows which chords belong and notices the departure. The second is called modulation: a change of root partway through a piece.
The point isn't to master this but to know that a departure in the harmony isn't a mistake, it's a device — and that it only works if the key was clearly established first. This guide goes no further here; that belongs to arranging.