Here is a good definition of DID while here is the PBX.
They are completely different things. PBX is a system while DID is a service.
PBX is the company’s private phone system.
DID is a phone number which can be associated to your PBX. You can use DID numbers as direct dial numbers to specified extensions in your phone system.