The post of Gundai was created when a Shugodai (deputy of Shugo; provincial constable) who had been exercising military and police powers during the Kamakura period began taking charge of affairs related to taxation (tax collection) as well at the start of the Muromachi period.
鎌倉時代、郡を単位として軍事・警察権を行使していた守護代（守護の代官）が室町時代に入り、租税関係（年貢の徴収）も行うようになったことに始まる。