The architectures are not the same. In XMPP, the server is the source of truth. It receives all stuff from the outside and arranges it in its database. You ask it "what's the status" and it can give you the snapshot you desire. Think favorite-search-engine that scrapes everything in the background and gives you instant answer to your queries.
In Matrix, it's a stream of events. So you technically have to fetch all events and then reconstruct the current state locally. Think scraping the web manually before searching locally.
There are, of course, ways to make it faster, but ultimately the fundamental difference means it will always be an upstream battle to make it as efficient, and the risk will always be to depend more on the server
Same, it feels so sluggish and slow compared to xmpp clients, even in small private chats, public rooms on matrix are on another level of unusable. Also that element is the only client that supports all features, would love to switch something more lightweight but most of them have some features missing (that i would miss) or even e2ee missing.
Because Matrix is designed as a distributed database instead of as a message passing service so Synapse has to catch up before you can do anything.. awful..
https://video.fosdem.org/2023/Janson/matrix20.mp4