This is considered to be a simile. This is a type of figure of speech wherein something or someone is compared to another person or item that is completely different from the former. For example, the sentence can be used this way: The rat was as brave as a lion. The lion is known to be ferocious and very courageous animal.
The rat is known to be meek but intelligent. Still, the rat is very different from the lion but they are being compared with each other. The person speaking is trying to say that the rat has shown bravery at some point in time. There are still other similes that people may not realize that they use all the time.