Parent and grandparent comments and their siblings provide a good summary of metaclasses. One of the best deep dives I’ve seen is this document [1] which is offline but still available through the Wayback Machine.
GP is right that metaclasses are rarely used and you’ll kind of know when you need them.