Complex sentence: These are countries where identity cards are not compulsory by law, but usually they are needed anyway for e.g. bank transactions.
Split into simpler sentences: These are countries which have national identity cards, but they are not compulsory by law. Some kind of identity cards are usually needed anyway for e.g. bank transactions.