The side lines of the squares cut off the triangle smaller "leftover" triangles.

In both cases, the leftover triangles can be recombined to form squares equal to the drawn ones. In the second case a small triangle in the right corner is left unmatched, meaning that in that case the square is smaller.

We may clearly give a more accurate answer.

In the first case, the area of the square is exactly 1/2 that of the triangle. In the second case it is only 4/9.

A question begs to be asked: could any assertion of the above be generalized to triangles of a more generic shape?