There doesn’t need to be any knowledge involved. It happens, because it works. Neither the beetle nor evolution itself “know” anything about quantum physics. The beetle is just a beetle and evolution is not even an entity that has any agency, it’s just a process that’s happening and that leads to remarkable results over time.
This is just one more example for the old discussion how complexity can develop through evolution. The classic example is the eye of vertebrates. Read up on that, if you’re interested in that discussion.
It’s not the name though, it’s the full taxonomy.
That’s like your mom calling out your whole ancestry before you get grounded for the rest of the summer vacation.
The scientific name only consists of the genus and species taxons, so Escherichia coli is already the full name.