0g means that there is none of the particular substance in the product, whereas "trace" means that there is a tiny amount, but for labelling purposes they cannot say "0g" or else it would be misleading.
A "trace" amount is so very very small, but food companies must state that it is present. Mineral water, for example, is 99.99999% water, but there are trace amounts of minerals.