Original: http://edu.china.unity3d.com/learning_document/getData?file=/Manual/TheComponent-ScriptRelationship.html
Components (Component) and scripting (script) relationships
When you create a script and connect it to a game object (Gameobject), the script appears in the viewer (Inspector) of the game object (Gameobject), just like a component (Component).
This is because the script becomes a component when it is saved-the script is just a specific type of component (Component). At the technical level, the scripting compiler treats other components as one component (Component), the same as the Unity engine.
So basically, the script is an integral part of your own creation (Component), and you'll define these elements in the viewer's display (Inspector). It will run any function you write.
Unity3d Basic Components (Component) and scripting relationships