A metaclass is class whose instances are classes.
Like an „ordinary“ class defines the behaviour of the instances of the class, a metaclass defines the behaviour of classes and their instances.
Some programmers see metaclasses in Python as „solutions waiting or looking for a problem“.
There are numerous use cases for metaclasses. Just to name a few: