We have learned that alcohols are versatile reactive species because they act both as nucleophiles and electrophiles. When they are used as electrophiles, the OH group is substituted with a nucleophile, and for this to happen, we need to first convert it into a good leaving group:

One option for this is the conversion of alcohols to alkyl halides, and among the many approaches, we will discuss the use of phosphorus trichloride (PCl3). It is used for converting primary and secondary alcohols to the corresponding alkyl chlorides:

Notice that in the last example, we have an inversion of configuration, and (R)-butan-2-ol is converted to (S)-2-chlorobutane. So, let’s see how this happens by taking a closer look at the mechanism of the reaction between PCl₃ and alcohols.
The Mechanism of Converting Alcohols to Alkyl Chlorides with PCl3
The reaction starts with a nucleophilic attack of the alcohol on the phosphorus, expelling one of the chlorines. This forms intermediate (1), which is then deprotonated by the chloride ion, forming an alkyl phosphorodichloridite intermediate. The process occurs two more times, and the trialkyl phosphite (a phosphite ester) is formed.
In the last part of the conversion, protonation followed by an SN2 substitution by the chloride ion gives the final alkyl chloride with an inverted configuration:

The simplified mechanism of the reaction, where the SN2 attack of the chloride ion occurs on intermediate (1), is also widely accepted.
Similarly, PCl5, PBr₃, and SOCl2 are also commonly used for converting alcohols to alkyl halides via an SN2 mechanism. As mentioned earlier, these are not the only ways of converting alcohols to alkyl halides. One of the most common strategies is the conversion of alcohols to mesylates and tosylates, which are excellent leaving groups and can be used in further substitution reactions via an SN2 mechanism:

Notice that the use of hydrohalic acids such as HCl, HBr, and HI is not inherently problematic, but the issues to watch out for are the possible rearrangement reactions and the presence of other functional groups that may not survive the harsh acidic conditions.
Reference
Gerrard, J. D. Isaacs, G. Machell, K. B. Smith, and P. L. Wyvill, Interaction of phosphorus trichloride with alcohols and with hydroxy-esters, J. Chem. Soc. (1953) 156: 1920–1926.

