The tension in a string holding a weight is often written down as m g without a second thought. That is right while nothing is moving, but not while the weight is in motion.
The equation for the hanging weight was m_2g - S = m_2a. Solved for S it gives S = m_2(g - a).
Only when a = 0 is S = m_2g. While the weight accelerates downward, S is less than the weight. The weight falls precisely because the string is not holding all of it back.
The figure raises the acceleration from 0 upward. The tension arrow becomes shorter than the gravity arrow and the gap between them opens. When a reaches g, S is 0, which is the case of a broken string and free fall.
The acceleration is already known. Put a = \dfrac{(m_2 - m_1)g}{m_1 + m_2} into S = m_2(g - a).
Bring the bracket over a common denominator. g - \dfrac{(m_2 - m_1)g}{m_1 + m_2} is \dfrac{(m_1 + m_2)g - (m_2 - m_1)g}{m_1 + m_2}, and the m_2g in the numerator cancels, leaving \dfrac{2m_1g}{m_1 + m_2}.
Multiply by m_2 and out comes S = \dfrac{2m_1m_2g}{m_1 + m_2}. m_1 and m_2 enter in the same way under exchange, which means either weight may be used to solve it and the answer is the same.
As a check, putting it into the lighter weight's equation S - m_1g = m_1a gives the same value. Solve with whichever of the two you prefer, and use the other one to check the answer.
Now look at how large this S is. The figure plots S against m_2 along the horizontal, with m_1 held fixed.
The line for S always lies between the level m_1g and the line m_2g. It is smaller than the heavier weight and larger than the lighter one. Only where the two weights are equal do all three meet at a single point.
However large m_2 is made, S never rises above 2m_1g. The dotted line in the figure marks that level. There is a limit to how hard the lighter weight can pull the string taut, and beyond it a heavier partner only falls faster.
\dfrac{2m_1m_2g}{m_1 + m_2} is the harmonic mean of m_1g and m_2g. It always lies between the two numbers and is dragged strongly toward the smaller one. The same form turns up for resistors and springs joined in parallel.
Finally, look at the axle holding the pulley. The string pulls down on both sides of the pulley, with size S on each. So the axle is pulled down by 2S, and the ceiling supports 2S.
Putting in the value found above, 2S = \dfrac{4m_1m_2g}{m_1 + m_2}. Compare this with the sum of the two weights, (m_1 + m_2)g. Since 4m_1m_2 \leq (m_1 + m_2)^2, the quantity 2S is smaller than the sum, or equal to it.
It is equal only when m_1 = m_2, which is to say only when nothing is moving. While the weights are in motion, the ceiling supports less than the sum of the two weights. The whole thing has grown lighter, if you like.
Where did the missing weight go? The falling weight is accelerating, and so it is not delivering its full pull to the string. This is the same thing that makes the body feel lighter in a lift accelerating downward.