The difference in behavior as electrolytes is due to the difference in the chemical bonding and structure of the two compounds. Sodium chloride is an ionic compound, where the strong electrostatic attraction between the positively charged sodium ion and negatively charged chloride ion makes it easy for the compound to dissociate into its constituent ions in water. Aluminum chloride, on the other hand, is a covalent compound, where the sharing of electrons between the aluminum and chloride atoms is much less polar than in sodium chloride, making it less likely to dissociate into its constituent ions in water.