Why can it be dangerous to provide credit card information

Why can it be dangerous to provide credit card information over the Internet? Does it stop the risk if you only use credit cards at local businesses?