Weirdly enough there’s one of the original versions of this toy in the toy box at our local pub and my three year old saw it and immediately knew that it was a phone. I have absolutely no idea how.
Nurseries have a lot of old books, and TV channels repeat a lot of old cartoons & other shows, so a kid may be exposed to old-style phones in passing quite a lot. And “in passing” is enough at that stage, when a growing brain readily hoovers up any and all available information.
I've found the answer to pretty much every "how do they know that?" is "A TV show". Although now that the older one can read and is in-person school, the answer is increasingly "Books" or "Someone at school".