“Unlike Egypt and Jordan, whose wars with Israel created bad blood and mistrust on both sides, the UAE and Bahrain have never engaged in military action against Israel.”
A big part of it is also shared rivals. UAE and Bahrain are a short boat ride from Iran. An alliance with Israel, and sales of Israeli military tech, is very useful for the two of them.
Egypt and Jordan have no similar threats.
I suspect the rulers in UAE and Bahrain are still close enough to the tribal chief culture, that they actually try to take care of their people. Many years ago my sons played with the children of the Oman embassador in DC. He was a really nice man.