Diatonic refers to notes or chords that come from the seven notes of the home scale of a song. A song is considered diatonic when it uses only notes and chords that belong to the scale of its key.
By contrast, non-diatonic notes are notes outside of the scale of the song. In Hookpad and Theorytabs, scale degrees that are not part of the song’s key are shown using hashed color fills to emphasize their non-diatonic status.
Borrowed chords and secondary chords are common sources of non-diatonic harmony, since they come from different scales than the song’s key and often include non-diatonic notes. Melodies that occur during these chords frequently make use of notes that match the new, temporarily implied key. This blending of harmonic and melodic color introduces tension and variety, expanding the expressive potential of a piece beyond what is possible with a fully diatonic vocabulary.
You Are Not Alone by Michael Jackson is an example of a song that uses both non-diatonic chords and non-diatonic melody notes. The progression features a ♭VI chord (A♭), borrowed from the minor mode, and the melody includes E♭ (shown as 3♭), a note outside the C major scale. Even though E♭ is non-diatonic, it sounds stable in this context because it belongs to the borrowed chord.