In a basic sense, shaders are nothing more than programs transforming inputs to outputs. These programs are run for each specific section of the graphics pipeline.
As mentioned in the Hello Triangle chapter, shaders are little programs that rest on the GPU.