The ERP runs the business: orders, stock, purchasing, invoicing. The MES tracks execution in production. The MES feeds shop floor data to the ERP, without which the ERP plans on figures typed in by hand.