A territory was a nation-state-like organizational entity on Sigma Iotia II, a planet whose society was based on Earth's Chicago gangster period. The planet contained about a dozen or so territories, not counting small fries.
These territories had no formal government but were instead run by outfits controled by bosses. Inhabitants payed a percentage to their boss, and in return expected their boss to take care of them, with services like laundry pickup and good street lights.
Bela Okmyx controlled the Northside Territory, which was the largest on the planet. Jojo Krako ran the Southside Territory and was an enemy of Bela Okmyx and the other gangster bosses. Upon surveying the situation in 2268, Spock noted the system to be unstable: it would have to become united or it would degenerate into total anarchy. In response to this, James T. Kirk unified the warring territories by establishing the Federation as a Godfather figure in control of a mob syndicate. Kirk's intervention created a planetary government on Sigma Iotia II, and ended the turf war between the bosses. (TOS: "A Piece of the Action")