A trade surplus occurs when a country exports more goods and services than it imports. In historical context, China maintained a surplus because Western nations wanted Chinese goods like tea, silk, and porcelain more than China wanted Western products, creating an imbalance in trade.