Hakka is one language in the family of languages known as Chinese.
The majority of its speakers are known Hakka people.
Hak 客 (Mandarin: kč) means "guest", and ka 家 (Mandarin: jia) means "family".
The Hakka people have their origins in several episodes of migration from northern China into southern China during periods of war and civil unrest. The forebearers of the Hakka came from present-day Henan and Shaanxi provinces, and brought with them features of dialects spoken in those areas during the time.
The term Hakka is thought to be comparatively recent.
During the reign of the Qing Kangxi Emperor, the coastal regions were evacuated by imperial edict for almost a decade, due to the influence of the remnants of the Ming court who fled to what is now Taiwan.
When the threat was eliminated, Kangxi issued an edict to repopulate the coastal regions once again.
To aid the move, each family were given an amount of money to begin their new lives and registered as Kehu, 客戶 "Guest Families".
The indigenous settlers who returned to their original lands saw the influx of newcomers.
The original inhabitants were protective of their own more fertile lands, and the newcomers were pushed to the outer fringes of fertile plains, or settled in more mountainous regions to eke out a living.
As time went by, local antagonisms grew, and it is thought that "Hakka" became a term of abuse used by indigenous settlers aimed at the newcomers.
Over time, this muted down, and became adopted as term of self reference for Hakka peoples.