Works just like regular onboard credits. Basically it's a pre-cruise credit to your onboard account. At the end of the cruise, when they tally up your bill, they just take the credit off the top.
The pre-cruise purchases enable other people to gift these credits to you for your trip. I'd personally rather have credits to offset my spa/drink/excursion bill than a gift basket or whatnot (although I sure wouldn't turn that down!).