What happens when opengl context is lost, how to restore it

I’ve recently found out that the OpenGL context is lost when we switch from full screen to windowed or vice versa (supposedly because we are creating a new window instead of using the previous one), but I also realize that I don’t really know the implications of this. What exactly changes when OpenGL loses context? For instance, while using GLEW, I know that we can’t initialize GLEW if we don’t have a rendering context, does this mean that when we create a new one we have to initialize GLEW all over again?

And about the textures, if we have to reupload the textures to the graphics card again, won’t the previous textures be occupying space as well? I mean, its not like they are freed, or should I free them before?

And what about the previous context, what happens to that?