In a shader a point light for example is represented as a vector sitting in space, a simple 3D coordinate.
And your normal is also a vector, but one that describes a direction based on what side of origin xyz(0,0,0) it sits.
You then have the mathematical operation of the 'dot product' that will create a value of -1 to 1 depending on how aligned two vectors are.
So You could dot between the lightVector and the normalVector of the surface and then have the shader move/exclude/whatever your light if it exceed some threshold.
Altering the normal based on lightVector direction would achive the same result.
You can do all kinds of exotic things no one would ever have heard of in shader code if only your mind could dream it up.
A shader is just a small program that decides the color of a pixel based on a bunch of vectors and numbers (light intensity, sampled texture color etc) and formulas you write up.
Tricky part is actually inventing something new that does something interesting, typically you just combine and mix old and well known tricks to make your shaders.