7.23Passing notes
Suppose chord remains C and melody:
E → F → G
F is not part of C major triad.
But if it passes between E and G quickly, it works naturally.
Think:
chord tone → passing note → chord tone
This is one of the most common melodic structures.