The assumption nobody tells you about
The DFT does not analyse the signal you recorded. It analyses the infinite signal you would get by repeating your window end to end, forever. That is not an interpretation, it is what the basis functions are: sinusoids with a whole number of cycles in the window, which is the only way they can be periodic in it.
If your tone happens to complete a whole number of cycles inside the window, the repetition is seamless and everything works. If it does not, the wrap-around creates a discontinuity that was never in your data, and the transform faithfully reports the broad spectrum of that artificial jump.
Key idea: Leakage is not measurement noise and not a bug. It is the correct spectrum of a signal you did not intend to analyse: your window, tiled.

