Selective plating is accomplished by masking a portion of a part or an assembly.
Why Mask The Piece?
An assembly might be made of several different materials and some of them might not be able to chemically withstand a given plating bath. (Aluminum might etch in an alkaline bath.)
Different finishes can be specified on a given part.
It is often more economical to plate a precious metal only where it is needed rather than over an entire part. The center of an IC lead frame is one example.
To avoid excessive buildup on fine machine threads.
To block blind holes.
How Masking Is Done?
Masking can be accomplished by dipping an end into a liquid that then dries to a solid (lacquer or some rubbers). The mask is generally peeled off after plating. There are also many different types of plugs or caps that are available. These plugs or caps are usually made out of vinyl or silicone rubber.