In a haloalkane, not all of the bonds are the same. We have to consider the fact that the halogen atom (for instance a bromine atom) is more electronegative than either carbon or hydrogen atoms, and has a tendency to withdraw electron density towards itself. This makes the C-Br bond polarised. The carbon atom has had electron density removed from itself, and now has a partial positive charge. Thus, it is more susceptible to attack by a species with a high electron density, or a negative charge. Such a species is called a nucleophile. A cyanide ion, for example, has a formal negative charge on the carbon.As like and unlike charges attract, the negative cyanide ion will attack the positive carbon atom, and in doing so will displace the bromide ion. This is nucleophilic substitution.