The idea of surprise is part of what makes something funny, or what gets a reaction. At least when I'm an audience member, after you hear a joke so many times it's not as funny because it loses its surprise or its twist. So I think funny has to do with surprise.
