The United Arab Emirates found itself for the first time in an alliance with its neighbor Iran, despite the dispute between them, as well as the Kingdom of Saudi Arabia.
It is in no way an alliance. It is more like a mutual interest that has gotten Iran and Saudi Arabia closer same with the rest, otherwise this particular conflict dates back to one or two thousand years ago.
Basically after WWII countries came together to give power to the regime in Washington. Now that the regime has proven to be abusive of that power, once again the world is coming together to take that power away. That's the mutual interest.
In fact, we do not know what criteria were agreed upon to choose to invite any of the countries, except that the process was in the form of suggestions from the first members, and not based on requests to join.
It is both, meaning all these countries did in fact request to join and also the original members want them to join.
Take Saudi Arabia for example. Obviously BRICS wants an oil rich country that is literary THE definition of petrodollar to join a dedollarisation movement and on the other hand the Saudi regime wants to join BRICS to gain more independence and be able to start investing in Arabia's infrastructure and industry (instead of handing over all their money to US weapons factories to purchase garbage), something United States never allowed to happen (eg. building its first nuclear power plant).
This is why Saudi has been lobbying behind the scenes with both Russia and China to get the invitation.