(Note I have already visited this post but it is about a specific way to calculate the Fourier series of a function, it doesn't adress why we actually can do this). After checking multiple resources, I thought I could use Fourier series to write periodic functions in terms of sines and cosines (or complex exponentiales, same thing), while Fourier transforms can be used to do the same thing but for non-periodic functions. Nonetheless, I realize it's not that simple, since I have just recently learnt we can also write the Fourier series of a non-periodic function if said function is defined in a finite interval. This series would then give us the periodic extension of our function, which I assume we would just then strip back down to our interval of interest.
However, if both periodic and non-periodic functions can be expressed using Fourier series, then what is the Fourier transform good for? Perhaps for the specific case when the interval is non-finite and the function is non-periodic?