Like you said, cats aren't dumb. There's something called trap happy - when an animal comes to associate the trap with good things and willingly triggers it multiple times in response.
Just like in the wild, this is probably due to getting a free zero-effort meal out of it. It probably also helps that a domestic cat already associates human smells with food and safety, whereas a feral cat will be wary and prone to extreme panic when caught.