It’s not about the difference between them but how these two services cooperate with each other. SIP trunking is a service that allows you to connect your
VoIP compatible onsite phone system to the cloud to have a connectivity with the outside world.
Hosted PBX
is already a telephony system that operates via the Internet but you can interconnect them to use some of the hosted PBX features
with SIP trunking, e.g. provide an inbound toll-free number or record calls.