As in the above picture, Biztalk architecture is clearly showing how pub-sub architecture works but I am also going to describe it in an easy descriptive way.
Firstly once a message is available any format like in well-formatted XML or file with the assistance of any adapter protocol like SFTP, File, etc. In receive port and if message format is flat-file then we need to a receive pipeline to convert it in XML because Biztalk only communicates a message in XML.
To get in-Depth knowledge on Biztalk you can enroll for a live demo on Biztalk Online Training

At this stage, XML message is not insert in Biztalk message box database because its need at least one subscriber but still only message is published at receiving port and when we create a send port with route a message with filter condition of its message context property or create an orchestration then create first active receive shape for receive port and then logical subscribers send port then whole XML message insert in Biztalk message box database and move message further as design orchestration business flow.
We can also create business rules separately and call it in Biztalk orchestration as per our requirement then send either in XML messages or add send pipeline at sending port for flat messages.
So in this way Biztalk pub-sub architecture works to complete a business process.
Take your career to new heights of success with Biztalk Training