The player characters are using past experiences or knowledge, previous encounters with mimics or stories of encounters with mimics, to be suspicious of the situation. They then use the tools they have, like a spell that will hurt a creature, to test if their suspicions are valid.
As a DM, the...