Comment by xattt
One reason, beyond cart theft, is aesthetics.
A grocery store at Bayview Village, an upscale mall in Toronto, uses this system to stop cart travel outside the grocery store parking garage. Mall management considers carts trashy and that they otherwise bring down the appearance of the mall. This was one of the conditions when the store opened in 2005. Their cart policy may have changed 20 years since.
Right, the real reason isn't to stop theft, it's to avoid the optics of store-branded carts being left around and save management the hassle of retrieving carts from nearby properties.