In the Four Years War with the Klingons (2241-2245) Starfleet was involved in its first fleet battles since the Romulan War. It was during this desperate conflict that Starfleet commanders came to see the need for a "space battleship" to anchor their task forces around and from which to direct co-ordinated attacks against the enemy.
Up to this point the Federation had not needed such a large combatant. Indeed, up to this point the Constitution class had been the largest, most powerful, and most capable vessel yet conceived of by Federation ship designers, and the original twelve had only been in service for four years by the time war broke out.
Jul`Kar forward starboard quarter
The Battle of Axanar that ended the war even featured the debut of the first Klingon "space battleship", the I.K.V. Jul`kar. Starfleet promptly classified this vessel as the "B1". However, the B1 was effectively just a built-up D6 Raxor-class battlecruiser with increased firepower, shielding, and speed; it demonstrated no improvement in fleet command capability as at the time co-ordinated attack went against the Klingon warrior creed of individual glory through great deeds.
While the star of the Four Years War eventually ended up being the Ares-class heavy destroyer, it was deemed insufficient to the task for going forward. Although a cutting-edge design before the introduction of the Constitution class, some twenty years later a new design was needed.
This design was to be imbued with great power, at least cruiser-weight armaments, a large crew to facilitate repairs and longevity in battle, and sufficient hull and redundant systems to give endurance and survivability in combat. These requirements were based neccessarily on what Starfleet saw of the Jul`Kar and how it fared in battle, but Starfleet learned their own lessons from that war and a fleet command ability was deemed a top priority, even over and above its own weapons suite.
The Federation-class dreadnought was intended from the start to be the flagship of a task force around which the other vessels formed up and took direction for co-ordinated action, or were detached from for important singleton duties as part of a co-ordinated, integrated approach to an incident. Thus the majority of the internal space within the Secondary Hull was taken up by the C4I (Command, Control, Communications, Computers, & Intelligence) systems, quarters for the Flag Staff operating them, and extensive shuttle and transporter facilities for personnel transfer. The Primary Hull was outfitted as the heavy combat section and emergency lifeboat, with extensive deflector shield grids, all the heavy weaponry and most of the primary weaponry, all the senior officers' and the majority of crew quarters, and the crew support systems. Even with the lack of this heavy combat section the Secondary Hull itself was a fully-fledged if limited duration starship.
After years of design and development thirty vessels of the "Federation" class were authorised in 2259. However, rather than use the extremely negative and pejorative designation of "battleship" with the politicians and Federation pubic, the vessels were classified using an old Terran word meaning "one who fears nothing". The construction contracts for Starfleet's first dreadnoughts were awarded to the only shipyards within the Federation capable of building the largest, most complex, and technologically sophisticated ships the Federation had yet seen.
The military, however, is ever at the whim of politicians and to a lesser extent public opinion. While the vessels were under construction the political winds began to shift, and neighbouring nations expressed their concerns to the Federation Council. These concerns took the form that the number of new super-powerful starships being built by Starfleet was already creating a new naval arms race with even friendly nations. The Federation's efforts to match the Klingons' projected battleship numbers had caused other nations to build their own, thereby forcing their neighbours to commence their own dreadnought construction programs out of sheer defensive need. In order to slow the headlong rush into armed conflict and excessive defence expenditure, the Federation Council agreed to limit its dreadnought numbers to twenty vessels, with most of them arrayed against the Klingons as their main adversary.
The unclassified general deck plans of the Federation class hid an important secret. The hull space behind the Hanger Bay and from Decks 18 to 20 (the deck under Warp Engineering down to the the deck above the crew quarters) is represented in these plans as a duplicate Sickbay and Ship's Computer (Deck 18), Botany Section, Hydroponics Bay, Observation Room, and Null Gravity Exercise Room (Deck 19), and Gynmasium, Recreation Area, Swimming Pool and the locker rooms for each (Deck 20).
What these decks actually housed was the heart of the dreadnought: it's C4I section.
Federation aft dorsal port quarter
Located squarely and directly behind the aft sensor dish the physical connection to which is at the far aft of Deck 19 this section is really why the aft sensor dish even exists: it is a dedicated sensor array and signal transceiver for the vessel's C4I systems. These highly-classified systems take up the majority of the aforementioned decks, and indeed are so extensive that only the dreadnought's hull can contain them and still leave room for the other necessary systems of a deep-space starship. These massive data processing systems gather, process, collate, and integrate data streaming in from myriad data sources to present a coherent picture of the designated operational zone, allowing the Flag Staff to make decisions based on the most complete and up-to-date picture available.