Properties of one compound differ from that of the other because of the following reasons:
1. Each compound is formed by a different set of elements.
2. Even with the same set of elements, different compounds are formed by varying numbers of constituent atoms.
Example: Just varying the number of carbon and oxygen atoms, we get carbon monoxide or CO (toxic gas) and carbon dioxide or CO2 (non-toxic gas).