Yes; it just a psychological trick to stop people abandoning their carts in random locations or perhaps even in the middle of the parking lot.
Also in the rare case that a cart is abandoned someone will quickly bring it back or use it themselves. The person abandoning the cart basically pays the finder
At my Aldis some of the more industrious folks will happily return your cart for you to get the quarter.
I remember people used to do this in Germany when I was a kid ~20 years ago at bigger shops. They would walk up to people loading their cars and ask if they can return the cart for them. I always perceived it as a form of begging. Nowadays I don't see it anymore.
In Berlin there are still people doing this.
It definitely is! You can also get these coin thingies you can have on your keychain for it. You push it in to push out the link to the other carts, and have to put the lock back in to recover the coin.