Your question is twofold, answer it separately.
How are mutually dependent classes created?
You are right, the Metaclass and Metaclass class are a feature of the parallel hierarchy of Smalltalk classes and metaclasses. How are they created?
It depends on the Smalltalk used. For GNU Smalltalk, I'm not sure, but for descendants of the original Smalltalk-80 (VisualWorks, VA aka VisualAge, SqueakPharo) are created in the Bootstrap process, which creates the original image.
However, at least for Squeak, this bootstrap happened at least 15 years ago, if not more. Metaclass , and its class may be even older than 30 years.
In short, both classes are created outside of typical image processing and are manually related.
But if the objects are years old, this leads to the question
What happens when you start Smalltalks?
Unlike languages ββlike Ruby or Python, which are also object oriented, Smalltalk does not need to create a basic object environment with things like Object every time it starts. Why?
When Smalltalk saves and turns off, it basically takes a snapshot of its entire object and saves this live object to a file. When it starts up again, it just needs to read the objects from the snapshot and βanimateβ them.
Therefore, for the Metaclass and Metaclass class both objects are read from the snapshot and restored, and from that moment they are fully functional; they no longer need to be created manually.