The money would be credited back to your credit card giving you a negative (ie the banks owes you money) balance. The vendor only has that card (unless you told them to send it elsewhere) so that is where they would send it.
Credit cards function effectively as a line of credit. The bank issuing the card agrees to pay the vendor when you use the card immediately and you get right with the bank later. You already paid the bank back for this loan in your scenario so the refund goes into the balance of the card but as a negative number (for the bank). I’m not sure what happens if you carry a negative balance into the next billing cycle, I imagine your card agreement has a section on that.
Latest Answers