These triangles seem to be exactly the same, and the coloured shapes are exactly the same. So how come there is an empty square in the second one?
The key to this lies in examining the slopes of the red and dark green triangles. For the dark green one, for 5 horizontal steps you rise by two steps and for the red, 8 horizontal steps gets you a rise of three.
As 2/5 is not the same as 3/8, the red and green triangles have different slopes.
This means that the green one is steeper than the red one, and if you look more carefully, you can see that the sloping side of thetop triangle 'bends' slightly inwards, while that of the bottomone looks like it 'bends' outwards. Therefore neither of the sloping sides are straigt lines.
The top triangle is thinner, while the bottom one is 'fatter', and this 'fatness' is where the area from the square went hiding.