Target (TGT -0.71%) was the latest victim of credit card and debit-card fraud last week, with hackers having stolen information on as many as 40 million cardholders. But as painful as the experience might be for customers, it provides a useful lesson on being smart about your spending.

In the following video, Dan Caplinger, The Motley Fool's director of investment planning, looks the different rules that cover credit cards and debit cards and how the same fraud can result in much different situations for credit card users compared to holders of debit cards. Dan notes that with credit cards, disputes happen before you pay any money to your card company, while debit-card disputes involve having your bank return money that has already been taken from your bank account. Moreover, laws covering fraud on debit card are much less developed than credit card fraud laws, leaving debit-card holders potentially at greater risk. Dan observes that card companies Capital One (COF 3.04%), JPMorgan Chase (JPM 1.94%), and American Express (AXP 0.85%) all take pains not to favor one set of cardholders over another, and he passes on some guidance that those card companies have given to their customers in light of the Target incident.