A shader is a program that runs in the graphics pipeline and tells the computer how to render each pixel. The graphics pipeline consists of six main stages: vertex processing, primitive assembly, primitive processing, rasterization, fragment processing, and per-fragment operations. In vertex processing, vertex shaders transform 3D coordinates, while fragment/pixel shaders color each pixel in the framebuffer during fragment processing. Together, vertex and fragment shaders control lighting, texturing, and other visual effects.