Do you know why is a ship called she?

Language has it to use ‘she’ when we refer to ships and boats, something that has its roots in the very old times. “Ships are referred to as ‘she’ because men love them” or “like a woman, a ship is unpredictable”, tradition used to say. But seriously, what is lagging behind this language idiom?