A naval shipyard is a original building unit from the game, The Conquerors. It is used to produce ships for maps that have water. It is made by having a building near the water.
As stated above, naval shipyards are used to make ships to travel around maps that have water. They can also make offensive ships, like a battleship, or ships that make planes, like the aircraft carrier. Later on in the game they are used for transporting mainly tanks due to planes not being able to carry tanks. Be careful when spawning a whole bunch of these as a boat can spawn on another and wither away to nothing. To use a shipyard, right-click the building and choose what boat/ship would you want in your navy.
Due to a naval shipyard having no special ability except to make boats and be near water, it can be used as a distraction to nearby enemy attacking boats.