Cg is a high-level shading language that is used to program the vertex and fragment shaders in Unity. Cg shaders allow for complex pixel processing and GPU calculations. In Unity, shaders are written using the Cg language and compiled for the target graphics API. Shaders have inputs like vertex attributes and uniforms, and outputs like varying values passed between stages. Common shader types include surface, vertex, and fragment shaders. Advanced techniques like multi-pass rendering are also possible in Unity using Cg shaders.