How do Naphthalene balls keep away moths?

The naphthalene balls used for keeping away harmful insects from damaging clothes are basically volatile chemicals having a strong odour. These compounds include a wide variety of aromatic chemicals which are mainly derived from petroleum and coal tar. These chemicals are toxic. As they are highly volatile, they produce vapours which repel insects such as moths and silverfish which damage clothes during storage.