When the code that uses it is optimized away by the compiler…
attribute float x ;
float y, z ;
y = 6 - (1+2+3) ;
z = x * y ;
…the compiler might manage to optimize that to:
float y, z ;
y = z = 0 ;
…and now ‘x’ isn’t needed - so it “does not exist” in the compiled binary of the shader.
Hence a variable that you might have declared and even used throughout the shader may simply not exist at run time. That’s why “inactive” variables are treated as if they don’t exist…because at the level of the binary shader, they literally don’t exist. But you don’t want it to be an error to pass a value for that attribute into the shader because very often you run the same mesh data through multiple shaders - some of which may use the attribute and others may not.