The answer must vary for everyone. And of course there are different kinds of funny. Some things only make you laugh with appreciation because they are so well done. That happens. Other things try to be funny and they are. There is slapstick, and then there is more serious comedy that contains excellent human observations that make one think as well.
There was a book by Woody Allen called Feathers. It tried to be funny and I thought it was. I do not have to approve of someone's lifestyle to think they are funny and laugh at them. I could always separate that.
To surprise a reader with laughter is less bold than obviously setting out to make people laugh while they are aware that they are supposed to. The latter is the harder assignment IMO.
I also find the cartoon King Of The Hill to be quite funny. I thought some of the old Beavis & Butthead episodes were hilarious too. Same writer.
I like either kind of comedy--the kind with serious undertones, and the kind that is obviously for no other reason than stupid laughter. What about yourself? Do you have some examples?