Helm's Deep was a large valley in the north-western Ered Nimrais (White Mountains). The valley was blocked over its entire width by the natural series of hills called Helm's Dike and behind that lay the fortress of Aglarond or the Hornburg, at the entrance to the Glittering Caves.
In the years of the Second Age before the Numenoreans settled in Middle-earth, tribal hillmen inhabited the lands west and south of the Misty Mountains, as far down as the valleys surrounding the White Mountains (Ered Nimrais). Uncultured and superstitious, they were wary of the tall men who came out of the west, and came to fear and hate them. They were hunted and persecuted in such numbers that they had dwindled by the start of the Third Age.
At this time they had come to congregate in the valleys of the White Mountains and the grassy plains of Dunland, which lay west of the Misty Mountains between Moria and Isengard; a few went north, and became the ancestors of the Men of Bree. Dunland then became the area most populated by these men, who came to be called Dunlendings.
When Eorl and his people were granted Calenardhon --- Rohan, as it would later be known, they drove the Wild Men from their new lands, earning their bitter hatred and enmity. The Wild Men were also driven from the White Mountains by the Men of Gondor. During the next five hundred years these swarthy, dark-haired warriors made frequent attacks upon the outlying settlements of Rohan, exacting revenge upon the usurpers, whom they called "straw-heads" because of the high number of blond warriors among them.
As a consequence, Rohan maintained patrols and garrisons to the west of the Fords of Isen to try to limit the number of raids, although these patrols had virtually disappeared under Wormtongue's stewardship, to the point where Saruman's forces could make incursions almost at will. Yet not everybody took against the Wild Men. At some point near the end of the thirtieth century of the Third Age, Saruman made contact with them and swayed them to his side by playing on their resentment and hatred of those who had taken what was theirs. Saruman welcomed to Orthanc a large warband of these Dunlendings.
Saruman evidently convinced them that they could reclaim what had been taken, and a fearsome raiding force comprising Dunlendings, Orcs and Uruk-hai left Isengard and began ravaging the western settlements of Rohan. Previous attacks by Orcs and Uruk-hai had killed many Rohirrim at the Fords of Isen, so there were no warriors to defend against the surprise attack. Many people of Rohan were killed in these attacks, but the raiders never made it across the country to Edoras; it is fair to assume that they encountered one or more Éoreds, companies of mounted warriors, who would have been patrolling the interior.
After the defeat of Isengard at the Battle of the Hornburg, the Rohirrim spared the surviving Dunlendings and used them as workmen to repair the broken walls of the Hornburg.