Some of the commenters here mentioned the PCI Express Base Specification.
( If you can access it, which would cost too much w/o PCI-SIG membership .. or are reading something written about PCIe, which is more affordable )
When you are reading that, ( in the Terms and Acronyms section ), there's a hint -
Packets with a Configuration Space address are used to configure Functions.
To help answer the original question, Yes ( Host i.e. Root Complex based ) Discovery and Enumeration of Device Functions is the first and foremost purpose of PCI Enumeration.
Without such Enumeration i.e. assignment of Bus and Device numbers, transactions cannot be routed from a Host to a Device - assuming there's a need for device access by the Host system. And without such configuration, Endpoint Devices cannot initiate transactions to be routed toward the Host or to other Devices.
PCI Express uses the same mechanisms as PCI .. with certain extensions.
Among the other subjects in this protocol spec, you may want to check these in particular. ( In PCI Express Base versions 3, 4, 5, or 6 ) -
§ 2.1.1 Address Spaces, Transaction Types, and Usage
§ 2.2.6.2 Transaction Descriptor - Transaction ID Field
§ 7.1 Configuration Topology
§ 7.2 PCI Express Configuration Mechanisms