A contra account exists to offset the balance of a related and corresponding account. A contra account is a perfect example of the debit and credit system, which is one of the most fundamental concepts in accounting.
In accounting, a debit transaction indicates an asset or an expense transaction. On the other hand, a credit transaction indicates a liability or gain.
In a contra account, since things are recorded to offset the balance of the corresponding account, transactions are represented in a way opposite to the norm. For example, an asset is recorded as a credit instead of a debit.
A more specific example, for the same situation, would be in the case of an account that records accumulated amortization. To balance the debit associated with the amortization, a contra account is recorded with the amortized amount recorded as a credit on its balance sheet. Again, this is done simply to ensure that there is a balance in the debits and credits in the accounting books.
Contra accounts are not limited to recording a debit as a credit. They can also work the other way around, as long as the function of having an account to offset the balance of the corresponding account is fulfilled. In cases where the credit is recorded as a debit, the contra account is referred to as a contra liability. For our example above, since the account shows a credit, it is called a contra asset account.