Advanced Resources
Non-diatonic chords are chords that are outside of the key a song is in. These chords are found in 6+ chord charts and are explained in-depth here.
How chords work in minor keys are explained here.
The way chords behave within a key is referred to as harmonic function. The various kinds of harmonic function and function of diatonic and non diatonic chords is covered here. This is invaluable for chordal ear training and songwriting.