A trade deficit occurs when a country's imports exceed its exports, meaning the country is spending more on foreign goods and services than it is earning from the sale of its own goods and services to other countries. This imbalance in trade flows is an important economic indicator that can have significant implications for a country's economy.