A trading account executes buy and sell orders, while a demat account stores securities electronically. Both accounts are essential for stock market investing, with the demat account providing security and the trading account facilitating transactions.