Yes that is a good question. Here is how I would answer your question. But, first lets get a little theory working.
If the melody line, lets call this the treble clef, and the bass clef share some notes you get harmony. Its the sharing of notes that let's the two lines harmonize and sound good.
Say the song is in the key of C. Treble (melody) notes would be taken from the scale of C. And the harmonizing chords would be taken from the chords in the Key of C. Chords are made by stacking 3rds of the scale, i.e. every other notes in the scale. The C, E, G notes for the C chord. D, F, A for the Dm chord and E, G, B for the Em chord, etc.
See how the C, Dm and Em chords harmonize the lower area of the tune that is in the key of C. Should add this; the C, F and G chords are the major chords in the key of C; and as this is a song in a major key they are your structure (most used) chords. The Dm, Em, and Am chords are the minor chords or your flavor chords. Simple sticks with the structure chords and as you get fancy the flavor chords can come into play. Moving on...
C, D, E, F, G, A, B, C, D, E, F, G, A, B, C.
While the tune is in the C, E, G area the C major chord would harmonize that part of the melody as you would have a sharing of the notes thus harmonization. As the tune went up scale and moved from the C, E, G area we need to find a chord that has some of the new melody notes. The F major chord F, A, C pretty well cover the rest of the C scale, so the C and F chord probably will be the most used chords if the song is in the key of C. The G chord would be used as a climax or move to resolution chord. Most music is built around this sharing of notes and the resolution pull of the V to I chords. If you keep this in mind you can assume what the next chord probably will be. Probably....
So yes when I'm jamming and the song goes up scale I go up with the IV chord; and when it goes back down I'd grab the C tonic chord. That G dominant chord will come in a couple of times in a verse and usually falls just before the verse is ending. As the verse's thought is coming to an end you need to end this verse with a V-I chord - returning to rest so a new verse - new thought - can start.
So yes if the tune goes up scale, find a chord that uses notes that are up scale from what you have been playing. The vi chord or Am chord is used in this way quite a lot. Good question...
Have fun.
One more thing. How many shared notes are necessary for harmony to happen?
One per measure. That is why we can pound out just the root and it sounds good.
Two per measure will sound better, this is why the R-5 or R-3 (3b) works so well.
Three per measure is probably not needed. It's like gravy, if you like gravy pour it on...
Question; Cmaj7 instead of C what's the advantage of the 4 note chord?