Debit Cards

I use a debit card for shopping. When I returned items to stores in the past, the store usually gave me cash. I didn’t mind because it saved a trip to the ATM. Lately they all want to credit the amount of my return back to my debit card. I rarely argue, it’s still going back into the spending pool, even if I don’t know the reasoning behind the change. However, I have noticed that, although the original debit payment to the store clears almost instantly, the credit back to the debit card takes several days to appear in my account. What is that all about?