Just a guess, as I only know a little about hearing aids, but maybe it's to measure the acoustic properties of the ear canal to be able to dynamically reproject the frequency spectrum of incoming sound to bands that the ear in question can actually hear.