The Pythagorean theorem is a special case

In the special case that angle γ is 90°, the red and the green triangles can be arranged (i.e. rotated,translated,
and reflected), so that their union makes a triangle congruent to the blue triangle
So, in this case, a' + b'' = c,
and so a2 + b2 = c2.

To see that the red and the green triangles can be arranged so their union is congruent to the blue triangle,
first we note that a'' = b'.
This is true regardless of whether γ is right.
Proof: By similar triangles b/a = b'/a'
and a''/b = a'/a.
From the first, we get b' = a'b/a.
From the second, a'' = a'b/a. And so b' = a''.

Thus we can arrange the green and red triangles so that the sides of
length b' and a'' coincide, and such that the two right angles are together.
We now have a triangle with sides of length a and b, and angles α and β,
same as the blue triangle. Hence this triangle is congruent to the original (blue)
triangle.

αβγabcαβaba'b''b'a''

Antecedents

It turns out that this had been discovered by Thābit ibn Qurra (836-901). See proof #18 at Cut the Knot and the Wikipedia.

The dissection of a right triangle to make two similar
triangles was described by Bhāskara II in the twelfth century C.E. in his Bijaganita.

Edsger Dijkstra generalized Bhāskara's construction to an arbitrary triangle, and used it to show that
signum( a2 + b2 - c2 )
= signum( α + β - γ ), where the signum function yields +1 for a positive number, 0 for 0 and -1
for a negative number.
Dijkstra's construction
produces two triangles from the original with the same proportions as those in the construction
above.