When you paint values over selected vertices, your strokes are applied only to the attributes corresponding with the selected vertices. In effect, the unselected vertices act as a mask, where only selected vertices are affected by any painting or flooding you do.
For details, see Restrict an area for painting