the easiest way to think of this is in terms of chords u are playin over
ok we are gonna stay in the key of c ionion but change mode
so c ionion has the notes c d e f g a b
the other modes have the notes d dorian ; d e f g a b c
e Phrygian; e f g a b c d
f Lydian ; f g a b c d e
(cant remember other names) g mixolidian ;g a b c d e f
a b c d e f g
b c d e f g a
ok now u might say they have all got the smae notres and u are correct, but the notes should be used differently. normally u try to play the root 3rd and 5th and somethimes the seventh a lot of mode u are playin in, but esp[ecially the root.
eg these notes in c ionion are ,root is c, 3rd is e, 5th is g and seventh b.
and in f lydian are f a c d and e.
now the reaons why these notes are these are chord tones. the notes in the chord that u are emphasisin by playin in that mode.
so lets say u play over the progression c majour, f majour, g majour.
now modally u would want to play c ionion then f lydian then g mixolidian. because u are emphasisin the chords u are playin over the lead will seem more connected to the rythm. by addin a few notes that arent root thirds fiths and sevenths (to an extent), u can extend the chord, u add something to the sound take it somewhere else. so u could play a few 6ths or 4ths for example in c ionion these would be a and f.
by playing enough chord tones (roots thirds etc) u create conection, and the other notes add colour. if there arent enough chord tones the lead is less connected to the rythm and therefore doesnt sound as if it fits much. if there are no non chord tones and extensions it will be a bit boarin.
if u werent playin modally over that progressions u would just play c ionion over the whole thing. it would still sound alright but less connected.
sadly it no use just learnin new scale shapes and playin over them u have to be aware which notes in the scale relate to the chords u are playin over.
this is a simplistic explanation but it gives u the gist. if u found this helpful please give me rep points click the little scale thingy on the top of the my message on the top right.