Nucleophilic Substitution Reaction : A chemical reaction in which a stronger nucleophilic (electron rich group which loves +ve centre) substitutes a weaker nucleophile is called the nucleophilic substitution reaction. For example, CH3Br + OH→ CH3OH + Br is a nucleophilic substitution reaction.
In haloalkanes (R—X) the halogen is more electronegative than carbon. Thus, C—X bond is polarized as C+—X-. Therefore, a strong nucleophile (electron rich species) such as Z attacks the positively charged carbon atom and replaces weak nucleophile halogen from C—Z. Thus a new product is formed.