Which class is responsible for creating an instance of the block in Magento?

In Magento, the whole block hierarchy during a page generation is created by the class Mage_Core_Model_Layout. The method generateBlocks is responsible of that.

public function generateBlocks($parent=null) {

// some code here

}