Surprise is only one element. Humor is about the inherent conflict between our expectations and reality, the conflict is only intensified when we don't expect it.
There are a lot of jokes I see coming a mile away, but there's a grade of execution for comedians too. If the timing is tight, even the most expected joke can still earn a laugh.