Why is there an extra conductor in my hew home's light switch circuit?
TLDR: Because NEC 404.2 requires a neutral be brought to all "switch loops" for future smartswitch use. 



Color codes are pretty weak in North American wiring.  You can go by color somewhat, but you're going to have to know what you're looking at.  

I don't like that system because you have to open up 3 boxes and stare at them for 5 minutes to figure out what you're looking at.  I like a much simpler system, and that's why I own 10 colors of tape.  I'm not stupid, it's just too much workload. 

Grounds all just connect in a big web.  They are the only wires that do. Neutrals do not.  Ignoring grounds,  wires have functions, I give the functions names, and I have an "ideal" color I like to make them, either direct or with tape tagging.  Certain functions are in certain places depending on where you are.  

Unfortunately most house wiring is done with multiconductor cable, which comes in fixed colors: black/white... black/white/red... whether you like it or not.  Hence the tape. 

Here are the color codes I prefer: 


hot (works much better if you choose black) 
neutral (Code absolutely requires neutral be white*) 
switched-hot (in a perfect world: red but not common) 


Incoming supply has two wires:  hot and neutral. 

A lamp needs two wires: switched-hot and neutral. (assuming you want it switchable). If it isn't that way, mark the wire with tape.  When a wire has two ends, mark both ends the same. 

A switch needs three wires: always-hot because hot has to come from somewhere.  Switched-hot so the switch can switch it!  Neutral (white) which must be present per NEC 404.2. Old style mechanical switches don't need it, but smart switches do, hence the requirement. 

Old style switch loops did weird things, like make the white (taped black) the always-hot and black the switched-hot.  That's no longer legal per 404.2. 

Your lamp may come with a black hot cable. Since you want the lamp on some of the time, I would wrap the wire with red tape to mark it as a switched-hot. 

See what I've done?  Everything is properly color-coded by function and you just go red to red, white to white etc. 



* White can also be gray, if you're willing to pay a fortune for custom Romex. Don't laugh, one Nevada builder uses pink Romex and has an understanding with every scrapyard and building inspectors to BOLO; any pink Romex not at one of his houses is stolen.