Also, they had mayors and stuff, a VERY clear class division and were technically under the rule of Gondor after the Northern Kingdom fell but Gondor didn’t really have the resources or urge to do any ruling over there. Once Aragorn was in they were essentially an autonomous zone under military protection in exchange for maintaining the local roads and bridges.
Thing is, the Shire was a hereditary monarchy, they just didn’t call their ruler a king - it was Thane. Pippin was in line for and did eventually inherit the title.
There’s also Buckland, the small offshoot of the Shire ruled by the Master of Buckland, and of course this title was inherited by Merry.