The acidity of a salt solution is determined by the ability of the salt to hydrolyze water. Hydrolysis is a chemical reaction in which water molecules are broken down into hydrogen ions (H+) and hydroxide ions (OH-). The extent to which a salt hydrolyzes water depends on the charge density of the metal ion.
Metal ions with a higher charge density are more likely to hydrolyze water because they attract electrons more strongly than metal ions with a lower charge density. This means that metal ions with a higher charge density are more likely to donate a proton to water, which makes the solution more acidic.
In the case of aluminum chloride and sodium chloride, the aluminum ion has a charge of +3, while the sodium ion has a charge of +1. This means that the aluminum ion has a higher charge density than the sodium ion, which makes it more likely to hydrolyze water and donate a proton to water. This makes the solution of aluminum chloride more acidic than the solution of sodium chloride.