what type of figurative Language is and why

The moon was a ghostly galleon tossed upon cloudy seas

The type of figurative language used in this sentence is a simile.

A simile is a comparison between two things using the words "like" or "as." In this sentence, the moon is compared to a ghostly galleon (a sailing ship) being tossed upon cloudy seas. The use of "like" or "as" is not explicitly stated, but the comparison is implied. Therefore, it is a simile.