The ancient ancestors of the Dunlendings inhabited the forested regions of Middle-earth on either side of the Gwathló in the early Second Age, and so were called 'Gwaithuirim' by the early Númenoreans. They spoke a language related to that of the Second House of Men, the Haladin, rather than the vastly different Bëorian/Marachian tongue which stood at the base of Adûnaic, and this lack of mutual understanding led to outright hostility. The Númenoreans greedily harvested their forests for timber, and after much war and bloodshed, the Gwaithuirim from south of the Gwathlo fled east to the Hithaeglir, while others scattered to the cape of Eryn Vorn and the White Mountains.
At the end of the Second Age, the land north of the Gwathlo and south of the Baranduin was named Minhiriath, 'Land between the Rivers', although the land south of Minhiriath remained unnamed. It's inhabitants were ignored, although a city grew up on the Gwathlo, west of the Misty Mountain hill-folk who had been Gwaithuirim long before.
It was not until Gondor abandoned this city (Tharbad) in T.A 2050 that the people and their land were renamed: both became known as Enedwaith, 'The Middle-folk' and 'The Middle Region', because they no longer owed allegiance to either North or South Kingdom.
These Hill-folk of the Hithaeglir kept their hatred of the descendants of Númenor, unlike those of Eryn Vorn and the White Mountains, who nevertheless remained uncooperative. The Dead Men of Dunharrow, for example, who betrayed Isildur, were descended from Gwaithurim.
When Gondor decided to give the depopulated province of Calenardhon to the numerous people of Éothéod in 2510 T.A., the Hill-folk of the Hithaeglir felt threathened by these 'Forgoil', or Strawheads (referring to the blonde hair). The Hill-folk had slowly colonized Calenardhon during the dwindling of the Dúnedain, and had already reclaimed all the land between the rivers Adorn and Isen.
Still, open war was not waged until the reign of Helm Hammerhand (2741 T.A. - 2759 T.A.). Freca, the lord of the hill-men (whom the Rohirrim now called Dunlendings) tried to get the throne of Rohan for himself by petitioning for the marriage of his son Wulf to the daughter of Helm. Freca was killed, and Wulf led the Dunlendings into open war with Rohan. They unsuccessfully besieged the Hornburg during the Long Winter of 2758–2759. Wulf did take Edoras and killed Haleth, the son of Helm, in front of the golden hall of Meduseld. But in the refuge of Dunharrow Helm's nephew Fréalaf held out against the Dunlendings. He recaptured Edoras in the end of the long winter and killed Wulf personally. The Dunlendings were driven out of Rohan, and Fréalaf succeeded the deceased Helm Hammerhand.
Guarding the Gap of Rohan was the fortress of Isengard, where a hereditary guard watched for Gondor. However, by the time of the Steward of Gondor Beren, these guards had mixed with Dunlendings, and it had become hostile to Gondor. To remedy this situation, Beren gave Saruman the keys to Orthanc, to guard Isengard for Gondor.
Saruman used this old history to tempt the Dunlendings into supporting him during the War of the Ring.
After the battle at Helm's Deep, the Rohirrim allowed the surviving Dunlendings to return to their homes. The Rohirrim required that all hostilities cease, and that the Dunlendings retreat behind the Isen river again.