in WW2, typically in a flag ship armada where you had say a carrier and a battleship, the carrier tended to be the lead ship in the armada with the admiral aboard the carrier. Granted, when the Mighty Moe came around, the battleship DID become the flagship of the fleet during the signing of Japan's surrender, but it was also the largest and most powerful ship we had ever built at the time as well as it was second only to the Bizmark.
As a history buff, I have to say that this was by no means a rule in World War II. Which ships were the "flagship" was entirely up to the particular Admiral and what ships were available. Early on in World War II aircraft carriers were still considered inferior to battleships (save perhaps in Japan), and battleships as a rule would have been the flagship. It was not until after the British raid on Taranto and the Japanese one at Pearl Harbor that the importance of aircraft carriers were realized.
The fact that most of the American battleships in the pacific were destroyed or disabled naturally lead to what forces that were left being lead by aircraft carriers. Thus the task force commanders who ended up leading operations like Bull Halsey and Spruance had aircraft carriers as their flagships because they were the only capitalships available, and thus they personally developed a preference for them. Tellingly though Spruance latter used the cruiser Indianopolis or the battleship New Jersey, and Admiral Nimitz when he rarely went somewhere often used the USS South Dakota as a flagship. Likewise for the Japanese, while the officer who carried out the attack on Pearl Harbor and midway's flagship was the Akagi, Admiral Yamamotto himself was usually safe behind the line on the Yamato, the largest battleship ever.
The main advantages for Battleships even in World War II is that they are harder to destroyed and have far bigger anti aircraft weaponry. Yamato for example took at least 11 torpedoes and 6 bomb ships to sink, and her sister ship Musashi took a lot more punishment than that. The main draw back was they they were slower than many aircraft carriers but this was something the Iowa class did not have a problem with.