Vertex shader positions all vertices in drawing space and, if needed, passes certaing varying variables to the fragment shader.
Fragment shader is where all the calculations about final color of the pixel/fragment are done.
So where does blending come into place?
When rendering the scene, there are final color buffer (framebuffer) and depth buffer (renderbuffer). Color buffer holds the RGBA value for some fragment at (x,y) position on the screen, and depth buffer holds the depth value for that same fragment.
If blending is not active, then if some fragment has the same (x,y) position, first the depth components will be compared (current pixel vs one from depth buffer), and if currently rendered fragment is closer to camera, its color would overwrite the one already written in the color buffer, otherwise both buffers would remain untouched.
If blending is on, than the part of the color buffer will be changed one way or another, and how it would be changed depends on the equation that is used for blending. There are many different blending modes and equations that can be used, you just adjust them to your needs.
Useful links:
- http://learningwebgl.com/blog/?p=859
- http://www.nihilogic.dk/labs/webgl_cheat_sheet/WebGL_Cheat_Sheet.htm (blending section)
Hope this helps.