According to the principle of superposition. The resultant displacement of a number of waves in a medium at a particular point is the vector sum of the individual displacements produced by each of the waves at that point.
Considering two waves, traveling simultaneously along the same stretched string in opposite directions as shown in the figure above. We can see images of waveforms in the string at each instant of time. It is observed that the net displacement of any element of the string at a given time is the algebraic sum of the displacements due to each wave.