This building allows you to build all of your naval units. In sea-related games it is a vital structure. It's the strongest structure in the game in terms of its health-bar; a nuke for example will not even destroy it. The simplest way to destroy naval yards is to use dolphins/subs.
In Naval War games you simply have to build more than one naval yard. Build 3 or 4 and then pump out subs. Then go and destroy the enemy's navy when you think you have sufficient subs. It is almost impossible to gain domination of the seas against an allied player if you lose it in the first place to them; so try to make sure of dominating the sea by building plenty of naval units early on.