When painting on polygons, you can paint only selected faces, blocking off the rest of the faces and protecting them from the paint. You can also flood your selection with paint (see Flood selected polygon faces).
To paint only selected polygonal faces
If your strokes extend to unselected faces, the unselected faces are unaffected.