Assigning Default References to a script itself versus a GameObject using that script?

Hi, this is my first attempt to dive deep into Unity so forgive me.

I am trying to understand the conceptual difference between assigning a prefab to a property on a script which is attached to a GameObject (e.g. the main camera), versus assigning this prefab to the property on the script itself (as viewed in the Inspector under Default References).

I ask because I was stuck for a while, confused that my prefab reference in my script was null since I failed to assign it to the proper place. What does it mean to drag a prefab (or anything) to a Default Reference of a script in the inspector?

It’s just the default reference. The default value is normally null but when you assign something to the default reference that value will be used when you create an instance of that class. That’s why the default references only support Unity reference-types (everything that’s derived from UnityEngine.Object as far as i know).

I’m not sure if those references will be used when instantiating objects from code, but in the editor it will work that way.