Both sets of strips are the same shade of gray: They came from the same roll of tape. When you change the position of the strips relative to the black and white bars, however, they seem to get lighter or darker. This illusion is not fully understood, but it seems to have something to do with the way your eye determines relative shading.
Your eye focuses an image of the striped pattern on your retina, the layer of light-sensitive cells at the back of your eye. Nerve cells in the retina begin processing the light and dark information in two different ways.
Some nerve cells in your eye look at the big picture, receiving information from a large area of the retina. These cells blend light from several bars and react as if the light were mixed together. When the gray strips are between the white bars, you see pale gray—a mixture of white and gray. When the gray strips are between the black bars, you see dark gray—a mixture of black and gray.
At the same time, other nerve cells in your eye receive information from a small area of the retina, and are sensitive to the contrast at the boundaries of the black, gray, and white areas, allowing you to see the striped pattern.
Both processes—one that diminishes contrast, and one that enhances contrast—would seem to play a part in your overall perception of the Sliding Gray Step phenomenon.
When all is said and done, however, a big idea to take away is that your perception of an object can be profoundly affected by its surroundings. As demonstrated in this Snack, the perceived color of an object can be significantly affected by the color of its background, or the colors adjacent to it.