ActivityPub (read: Fediverse, Mastodon, PeerTube, etc.) is a way for social media site you use to ask other social media site what posts there are for another profile and proof you like or comment it. Something like two-way RSS feed.
SMTP (Email), XMPP and others are working soft of a way that you request from your email/chat provider to send a message to username@server
Matrix is also a different thing. It create a data structures called rooms that are spread across many servers, that those servers synchronize between each other pulling and pushing latest changes and then your client (app) is synchronizing latest messages with the server.