How does \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection::addAttributeGrouping() work?

Context: How does \Magento\Eav\Model\AttributeRepository::getList() work?

Details: How does \Zend_Db_Select::group() work?