If we only measure the signal for a short time, the Fourier Transform works as is the data were periodic for all time. Sometimes this assumption can be correct: The diagram shows what happens if we only measure a signal for a short time: the Fourier Transform works as if the data were periodc for all time. In the case chosen it happens that the signal is periodic  and that an integral number of cycles fit into the total duration of the measurement. This means that when the Fourier Transform assumes the signal repeats, the end of one signal segment connects smoothly with the beginning of the next  and the assumed signal happens to be exactly the same as the actual signal.
