Here is the mathematical secret...
Ignore the two triangles. The answer is in the Green/Yellow Rectangle.
Law 1 - All shapes of a given area A, do not have the same perimeter P.
The green shape, has a perimeter of 14 and an area of 8.
The yellow shape, has a perimeter of 14 and an area of 7.
The important figure here is the net perimeter...
in other words, how much of the perimeter is shared and overlapping, and how much is not.
net perimeter = total perimeter of both shapes (28) - the shared overlapping perimeter
In the top, the total area is still 15, but the net perimeter is 16.
In the bottom, the total area is still 15, but the net perimeter is 22.
The combination of the area and net perimeter, determine the gap appearing in the bottom shape.
hope this explaines it for you.