Aggregation occurs due to several factors, including the surface energy of nanoparticles, the presence of ligands or other surfactants, and the ionic strength of the surrounding medium. High surface energy makes nanoparticles thermodynamically unstable, leading them to aggregate to minimize this energy. Additionally, environmental conditions such as pH, temperature, and the presence of salts can influence the extent of aggregation.