Think of it as a declining balance on your account. Say you have $200 onboard credit on your account. You board and buy a drink. that amount would then be deducted from your onboard account. You go to the spa or the shops and buy something...that amount now gets deducted from your onboard account. that will continue until you use up your onboard credit. then you will rack up charges to your onboard account that must be paid off at the end of the cruise by either cash, credit card, etc.
MJ