How standing waves form
A standing wave appears when two waves of the same frequency and amplitude travel in opposite directions and superpose, most commonly an incident wave and its reflection from a boundary. Their interference produces a pattern that appears to stand still: certain points, the nodes, stay permanently at zero displacement, while points midway between them, the antinodes, oscillate with maximum amplitude.
Unlike a traveling wave, a standing wave transports no net energy along the medium. Energy instead sloshes back and forth between kinetic and potential forms within each loop of the pattern.
Standing waves in musical instruments
Instruments work because a string or air column only sustains standing waves at frequencies whose half-wavelengths fit the boundary conditions. A string fixed at both ends has nodes at each end, so its allowed wavelengths are 2L, L, 2L/3 and so on, giving a fundamental and a harmonic series of integer multiples.
A pipe open at both ends has antinodes at both openings and supports the full harmonic series, while a pipe closed at one end has a node there and an antinode at the open end, allowing only odd harmonics and sounding an octave lower for the same length. These boundary conditions set each instrument's pitch and timbre.