The people used to scatter in the valleys and mountain passes when encamped during a journey. The Prophet (may Allah's peace and blessings be upon him) informed them this is inspired by the devil in order to instill fear in them and lure the enemies of Allah (to attack them). After that whenever they set up their camp they would stay so close together that if a garment were spread over them it would cover them all.