They may refund to the form of payment you used so if there’s a chance cancellation, people paying with gift cards should make sure to keep the actual gift cards (and not throw away), if you don’t use a website to combine them into one balance before use.
^This - it can be a big hassle with refunds when you pay with gift card(s) and do not keep them. One of the reasons I do not like GCs - that and the fact that I have just tied up my money for a single purpose.
You can also use this to combine gift cards. I usually keep one gift card in my wallet at all times and then I buy electronic ones from Target (at 5% off) and then transfer the electronic ones to the one I have in my wallet.