A trade deficit occurs when a country's imports exceed its exports, leading to an outflow of domestic currency to foreign markets. While often viewed negatively as it can indicate economic weakness, a trade deficit can also reflect a strong domestic demand and investment opportunities that attract foreign capital.