When you have taught an automaton how to build others of its kind, it is a small step to make it build itself.