What you pay
The Sony WH-1000XM5 runs about $398, the Bose QuietComfort 45 about $329. The Bose is a little cheaper.
Noise and battery
The Sony cancels slightly more noise and offers finer app control, and lasts about 30 hours to the Bose's 24, often more in practice. Both block enough that the gap is small.
Comfort and durability
The Bose is comfier, folds, and packs smaller, with no record of the hinge cracking that can cost $199 to fix on the Sony. For years of daily use the Bose is the steadier pick.