There's something about old worldbuilding in 'Bleach' that always gets me excited — the Gotei 13 didn't pop into existence overnight; they grew out of a need for order in a realm of souls. From what the manga and related novels lay out, the Gotei 13 are the organized military/police force of the Soul Society: thirteen divisions, each with a captain and lieutenant, designed to patrol, judge, heal, research, and generally keep balance between the worlds. Historically, their creation was part of the Soul Society's early institutionalization — as souls, spirits, and hollows proliferated, the system had to centralize defense and governance, and the captains emerged as natural leaders who could wield enormous spiritual power and command squads. That slow solidifying of roles is what birthed the divisions you see in the series.
A big reason the structure is so durable in canon is the grip of figures like Genryūsai Shigekuni Yamamoto, who served as Captain-Commander for centuries and was a cornerstone of the system. He and the founding generation formalized many rules, ranks, and functions — think of it like an ancient constitution for the Soul Society. Over time each division specialized (healing and medical relief for the 4th, scientific research for the 12th, etc.), and politics, noble clans, and bloody conflicts (notably the long conflict with the Quincy and the upheavals shown in the 'Thousand-Year Blood War' arc) forced reorganizations and purges. The Gotei 13 you know in later arcs is the product of centuries of war, tradition, and power struggles.
I love how the canonical history never feels like a dry timeline; it's layered. Small details from side materials like 'Can't Fear Your Own World' expand on how squads reshaped after big events and how certain roles (like the Royal Guard/Zero Division later serving directly under the Soul King) split or changed. The human-yet-immortal element — captains getting promoted, squads losing leaders in combat, new customs forming — gives the Gotei 13 that lived-in feel. Whenever I rewatch or reread, I catch tiny hints of that evolution: a uniform change, an old grudge, or a training tradition that points to centuries of institutional memory, and that always makes the organization feel real to me.