Visual illusions confuse the brains normal predictive logic when it comes to how certain things should look or behave in the real world. The brain makes a lot of assumptions about the world around us speeding up processing in the brain and stopping our brain from overloading.
If certain things about an image are ancillary not important the brain will end up disregard them and put hem in the background.
Many prediction made about images override what you are actually seeing this is what illusions take advantage of, the fact that the brain takes shortcuts and informed guesses about the world around us.
Other objects and shapes surrounding can also influence what you see.
For example the illusion above tries to make you believe the blue circle on the left is smaller than the blue circle on the right. Well they are actually the same size, its just the small and large circles surround them that cause you brain to judge them as different in size.
This illusion causes you to believe that the two horizontal straight lines are bending slight, but of cause they aren’t, this form of mild hallucination is caused by your brains pre-disposed assumptions.
The Grid circle illusion takes advantage of your minds tendency to disregard information in your periphery. When you look directly at the circles they appear white but when you move your eyes around the image they flash to black when they hit you peripheral.
This is you brain blending the more extraneous information into the background. All that is central to you vision is important anything else is well considered secondary.
Its hard to see these two lines are actually the same length without the carrot tops being there, but, they are and you can test it if you like.
Much like how you browser will cache data about a webpage to speed up processing, so does our brain. It will use perceptual predictions to speed up processing in the brain, this has obvious advantages for increasing reaction times in the heat of a moment.