As this book explains, such diversity in neuronal types and connections is generated at various levels.
Neural stem cells change their competency over time, giving sequential rise to distinct types of neurons and glial cells: initially deep layer neurons, then superficial layer neurons, and lastly astrocytes.