This is a version of an illusion discovered by Jacques Ninio. Imagine that the coloured rectangles are real translucent plastic sheets, different in colour but identical in size. They are shown in correct perspective, as they would appear if both were sloping away from us at the same angle. However, the nearer one appears to slope much more than the further one. Ninio shows the effect with a diagram of arches in his book The Science of Illusions, p. 27 and fig 3-7. He explains it as an example of the way that we sometimes seem to compress visual space with distance, so that for example a flight of stairs seen head on looks steeper the further we are from it. It’s a reminder of the way that visual space is far from geometrically regular. The distortions of space must have evolved because they are advantageous in everyday vision. But in the unusual arrangements presented in some optical illusions objects can appear distorted, as in this illusion and in size-constancy effects. With those, space and objects seem to expand with distance, rather than contract as in this illusion.
Like the effects in many illusions, it is the unlikeliness of this configuration of inclined planes that makes it a challenge for the strategies we normally find reliable in making visual sense of the world. When planes in our field of view are seen in a more usual configuration, aligned with gravitational vertical, we have no problem in correctly judging their inclination in space, even if the planes are inclined in relation to our field of view. Try this picture of some more imaginary planes, this time in the cathedral of Sees, in France.
For another case where the brain struggles with sloping planes, see the post on the wonky dagger and balconies illusions. In those illusions, puzzling sloping planes are shown, but not, as here, at different distances. Instead, the slope in those cases is ambiguous.