Why do cats do weird things?

Cats do a lot of quirky things, like sitting in tiny spaces and jumping when they see a cucumber. It makes for quality entertainment, but is there a reason behind these odd behaviors, or is [...]