Depending on the age, they do it on purpose. Sometimes it’s because they are just figuring out social situations – doing X to person Y results in action Z.
You can find videos of babies pretending to be stuck and crying to get attention. When “unstuck” and not given attention, they stop crying, get themselves fake-stuck again and start crying again. They want the attention and coddling that they got the last time they were legitimately stuck.
I’m sure some babies know they’re faking it.
MMOs are probably a good indication.
I think researchers (or just casual investigators) studied MMOs to see how people might react in a plague situation (I want to say WoW, but it might’ve been EverQuest).
They ended up discarding/writing off their findings because they figures that there wouldn’t ACTUALLY be trolls who’d go around spreading the virus on purpose, and also that because the virus only had negative effects, no one would be doing actions that would nearly guarantee infection.
Of course, 2020 showed us that we really should’ve been looking at what people do in MMOs…