Gross margin is influenced by factors such as production costs and pricing strategies. A company can improve its gross margin by reducing production costs or raising the selling price of its products. On the other hand, operating margin is affected by both the cost of goods sold (COGS) and other operating expenses, such as rent, salaries, and marketing costs. Efficient management of these expenses can help improve operating margin.