Acetal Formation Mechanism
Intramolecular reactions are always preferred over intermolecular. 

Remember that these reactions are reversible so even if the intermolecular attack proceeded, the product would be unstable with respect to intramolecular attack by the free OH that is within the molecule.