Spectral leakage is a phenomenon where energy from a specific frequency “leaks” into adjacent frequencies when a Fourier Transform is applied to a finite Sample of a Signal, that is, if you “cutoff” a part of a signal by Windowing it using rect as the windowing function. This distortion is a downstream effect of abruptly cutting off the signal function before you transform it. By converting the original signal into the same exact waveform but with tapering to zero on the edges of the window, you are self-containing the input to the transform, meaning that the transform won’t have those nasty distortions. Hann Window, Hamming Window, and Blackman Window are all different flavors of achieving this edge tapering. Why does “self-containing” fix our problem? Well the Discrete Fourier Transform (and by extension the Fast Fourier Transform) operates on finite Domain, unlike the Continuous-Time, regular Fourier Transform. Accordingly, it treats the input sample sequence as periodic. Consequently, if the beginning and end of the sample sequence have a huge jump, like what you would get with a Rectangle Window, it means that the final frequency domain output will have to compensate to make up for the infinitely steep jump in amplitude caused by the discontinuity.