After WWI Germany had severe restrictions on its military, including its navy. One of those restrictions was no battleships.
While Germany was rearming under Hitler, eventually all those restrictions were ignored. But he couldn't go balls out all at once. He had to move incrementally. One of those first steps was a "pocket" battleship.
It had the armor of a battleship, but it was MUCH smaller, only slightly bigger than a regular heavy cruiser. It has battleship-size guns, but only a few of them.
Remember, prior to WWI entire NATIONS had bankrupted themselves trying to show that they were a world-class power by building and deploying just a single battleship. Even Russia never did build a battleship. They were just too expensive.
So with a pocket battleship you ended up with a ship that was just as expensive to build and maintain as a battleship. It could outclass any heavy cruiser or smaller ship. And one was a legit threat to any "real" battleship, at least for the first few salvos. As the battle went on their smaller number of guns would spell their doom. Unless they got a lucky hit, which was something that could happen. That's how the HMS Hood was sunk. A lucky hit from the Bismark blew her apart.
Remember what I said about battleships being so expensive to build? Politicians were TERRIFIED of sending battleships into battle because one of theirs might get sunk.
The big naval "battle" of WWI, Jutland, was basically little more than a dick wagging contest. British Fleet Admiral Jellicoe had the German Navy TOTALLY outgunned - 28 battleships to 16 battleships. Every authority says Jellicoe could have smashed the German fleet into junk. But he was so afraid of having one of his own battleships sunk that he never engaged, and allowed the German Navy to withdraw.
In WWII, after the Bismark sunk the Hood, the Royal Navy engaged is a HUGE operation to sink the Bismark, and they got her. Hitler was so scared by this that he hid her sister ship, the Terpitz, for the rest of the war.