The primary reason they do this is because of the window moving in and out. This movement creates small amounts of friction between the frame or sashes and the window opening. This friction causes movement which produces noise.