Title of ban was used in Croatia. First recorded in 950. and used up until 1918.
Hungarians adopted the title, and used it to denote border marches under governors with additonal authority and judical and military control. Such marches were often called banates under ban, it was to an extent a copy of system in place in Croatia. Origin of title is unknown but there are 2 major theories.
According to 1st- its Avaric origin, from a personal name of Avar khagan called Bayan. Problem is its a personal name and was never a title.
2nd is Ban, it was a germanic/frankish name for banner, term which meant that feudal army of certain area would assemble under bannermen and a banner.
So perhaps a ban was originaly someone assembling the army in certain region.
Croats were a border march for Franks in early 9th century, so the term could have been created then.