Use of Difference Account in stock entry?

While we make material transfer and manufacture purpose stock entry.in accounting ledger commonly two or three ledger will be there like store,work in progress and finished goods.but some times difference account ‘cost of goods sold’ will show in stock entry accounting ledger and there will not be any difference amount.why difference account ‘cost of goods sold’ is shows in stock entry ?

@renjukumar
The difference between the value of the items remaining to be sold and the previous period’s stock-in-hand value can be positive or negative. If positive, this value is removed from expenses (cost-of-goods-sold) and is added to assets (stock-in-hand / fixed-assets). If negative, a reverse entry is passed.

To learn more on Inventory accounting, please refer the link below.
http://frappe.github.io/erpnext/user/manual/en/stock/accounting-of-inventory-stock/

Hope this helps.