How would you compare xmpp to matrix? Are they both similarly secure, distributed, and open source?
The difference becomes relevant when you have multiple or offline devices. XMPP may not deliver messages to some of the devices (for example, if message carbons are not supported by client). Matrix will not drop messages -- it may take some time, but eventually all devices will see all the messages.