Answer
It coordinates lithium and other cations, breaking up aggregates and making enolates and organolithiums more reactive and less selective toward O- versus C-alkylation.
Detailed question
What does HMPA do in a reaction?