In simple terms, similies and metaphors are used to indirectly describe something with the intention of giving the description a more profound meaning than if you were to use standard plain English.
For example:
Camels are ships of the desert.
This describes the usefulness (or functions) of camels. If you imagine the desert to be an ocean, then camels would serve as vessels (ships) that transport people and goods accross it.
This metaphor uses the idea of ships and the sea to describe camels and the desert.