How can an electret microphone have a more or less flat response?
If you are concerned with linearity of voltage response to membrane displacement, the response is linear. Instead of reconstructing the math myself, here is the explanation from openmusiclabs.com:



As one can see, the response is linear, which is why electret (and condenser) mikes are the best.

The "flatness" of frequency response over the range of acoustic waves is provided due to small size of membrane relative to acoustic wavelength.