Well they are two different things used in two very different ways.
You inherit from a class, usually, to gain/override the functionality provided from the more base class. In Unity, for example, the default script inherits from Monobehaviour because its assumed that most of the time you’ll be making a component attached to a game object, that requires the usual Unity messages such as Awake, Start, Update, etc. But you can then inherit from other classes, say, ScriptableObject, when you need to make a class with different properties. You can also inherit from no class and have a vanilla C# class.
It’s worth noting, in Unity you can’t instantiate Monobehaviours or ScriptableObejcts or most if any of the stuff that has something going on in the managed C++ land with the usual syntax of ‘= new YouClassName’. Instead you use AddComponent or CreateInstance in respective order.
Instances are used for, well, when you need a copy to work with. And this can work in tandem with inheritance, as they’re rather different tools that you use in code.
So for example you can outline a base class with a virtual method like so:
public class SomeClass
{
public virtual void DoStuff()
{
//Do Stuff
}
}
Then you can inherit from the class to override the virtual method:
public class SomeDervidedClass : SomeClass
{
public override void DoStuff()
{
//Do Different Stuff
}
}
Then in another script, you can create instances of these and use them:
public class SomeMonobehaviour : Monobehaviour
{
private SomeDerivedClass derivedClass;
private void Start()
{
derivedClass = new SomeDerivedClass(); //here you're instantiating a new copy of the class, assigned to a private field
derivedClass.DoStuff(); //and now you're doing stuff with the instantiated copy
}
}
The best way I can put it with my limited skill, is that you inheriting is part of the nature of a script. And then you instantiate classes when you need to put them to use. It’s not really a case of one or the other.
When you want something to be able to do something that exists in another class, then you may inherit from that class, like we do with Monobehaviour. When you want to do something with that class, then you work with instances of it.
Hopefully that makes sense. Maybe someone here with more experience can outline this better.