DanLisaHall gives good advice. I double checked with Consumer Reports and they agree for the most part with TrueDelta. They mention some squeaks and rattles early on in life on the BMW X3 which is pretty annoying, but nothing serious for the first five years of owership. 2018 was a remodel so it also mentions some minor engine issues for a few customers, usually concerning the fuel system - but that is it in five years going back to the last redesign (2014). Older then things start to go.
The X5 is reliable back to 2014, nothing comes up at all - not even on the redesign in 2014 except squeaks and rattles. Engine minor, climate controls, and some suspension issues crop up in 2014 but nothing else. These are both actually better among the BMW brand options.
Volvo XC60 according to CR is less reliable than the BMWs to my surprise. 2016, 2017, and 2018 are generally okay. But 2015 and earlier have drive system, fuel system, electrical system and power equipment issues. So they don't seem to last as long as BMW generally speaking. CR is a little off on showing problems as if 1% of the cars show an issue in year one, they start marking it down in a catagory. So it is overly senstive to concerns.
The Mazda CX-5 is very reliable according to CR. It has virtually no issues to its launch back in 2013. Only in 2013 does it show a few problems with brakes (and CR does not differentiate with brake work and brake pads, unfortunately) as well as body hardware issues (controls breaking inside the car). Besides those two things, all years from 2013 show no issues. So on straight reliablity, it beats all of the above.
Priorities: Safety & braking / Driving position & visibility / Reliability & durability
So for safety and braking, it depends how the car is equiped with anti-crash features. I have driven all four of these as I was recently in the market for a similar size SUV or mid-size sedan. Of course I recommend you drive them as well to see what you like.
BMW X3 - This has the best EPA gas mileage for its size at 24 mpg and is also fast, at about 6 seconds. Ride is also very comfortable and while (because it is smaller) better handling than the X5, I still felt the Volvo and Mazda were better to my surprise. Has the most luxiourous interior along with the X5. The gear selector is electronic, so if you adjust to that, you are golden. I think it uses an older infortainment system than the X5 as the terrible gesture control was absent and the menu structure was better than the X5.
BMW X5 - Has the best EPA gas mileage for this size SUV at 23 mpg and is the fastest in this group, at about 6.0 seconds to 60. Ride is very comfortable and suprisingly, the driving is the least inspired in this group. However very quiet and comfortable to be in. the infotainment system is the worst.It has a layered menu structure and busy control layout. For instance, resetting the trip odometer is buried in a menu, so it takes a few toggles to get to that. Worse, BMW has added gesture control, which is meant to let the driver make volume adjustments, or accept/reject calls with a wave of the hand. Except my wife in the passanger's seat could accidently activate the system. I would avoid it if you can - the gesture system is just awful.
Volvo XC60 - This probably is the best driving of the four. Very stiff ride as a result in comparsion. It steers very nicely. The steering has ideal effort and good feedback as well. About 6.5 second 0-60 so very fast. Did not like the infotainment system at all in this one.
Mazda CX5 -The CX-5 has a nimble feel. It steers nicely with a satisfying responsiveness and precision. The steering has ideal effort and provides good feedback. Around 7 seconds 0-60 with the turbo trim, so fast. Did not like the Infotainment system as it was pretty slow to respond (complexity reported in reviews did not phase me on this car, however).
As I wrote above, try these cars out yourself. I tried the 2018 but I don't think any of these were redeisgned extensively for 2019, as the X5 was new for 2018. Did I buy any? No. I looked at two more cars, the Lexus RX which I was tempted by as well as I was tempted by a massive discount on a loaded 2018 Buick Envision as it was more than $15,000 under list on it (since the changed 2019 came out in April) and that car handled better than the BMW as well (shockingly). I bought it last April and love it for its handling, gas mileage, acceleration, and relliablity although I only have 15,000 on it after 10 months - nothing has gone wrong. Best of luck with your choice, those are four pretty good cars in all aspects for at least 5 years, so it depends on what you like the most (and how long you want to keep it).