The usual description of a standing wave (which you are working with) is too limited and doesn't bear close examination. A 'real' standing wave on a string, in the case where there is resonance, is what you get when there are a
large (infinite) number of waves. The same wave train will have been that have reflected back and forth for a long (infinite) time. If the path length between the ends is an integer number of half wavelengths, the energy will build up in step to form the antinodes and you will get your familiar standing wave pattern.
Unless you are prepared to have an infinite build up of energy in your system, there will be some loss. There
has to be some loss, in fact, because, at the very least, the source of energy will have a finite 'source resistance' and there is always friction in one form or another. This limits the build up of energy until the
rate of energy supplied equals the rate of energy dissipated. (The Q factor of the resonator) If the frequency of excitation is not equal to the resonant frequency, the waves will troll up and down the string without producing any stable interference pattern.
The reason that a resonance actually allows the energy to be stored in the standing wave (it will carry on for some time after the source is switched of) is a clever one and it's because, at resonance, the Impedance presented to the source by the string is very different from the source impedance so energy takes a while to get into the resonator (build up) but also doesn't all "get out" until the amplitude of the oscillations has built up to its maximum.
PS. You will get a standing wave on a string, tied at just one end and with a perfectly 'matched' excitation source, at all frequencies. In this case, the peak amplitude will be just twice the amplitude of the applied wave.
PPS But strings are really not the best examples of easily analysed standing waves. You can get much more
measurable results using an electrical transmission line which can be seen to follow the theory much closer. You just don't know what your hand is doing to the end of a string as you wave it up and down.
