A mechanistic study of the formation of polymer nanoparticles by the emulsification-diffusion technique