You can’t exactly pin-point the element of joke and “serious” hacks, but usualy, joke ones use a wide arrange of portraits with varying styles, some even featuring characters from other games, like having Mario from Hotel Mario as a playable character.
In this way the game indirectly tells the player not to take the game too seriously.
But some may opt not to, and just stick with splices or custom mugs (for example, the Heroes We deserve, and many more).
Joke hacks often have memes and a silly plot, in order to flesh out the comedy present in the interaction between characters, but again, this doesn’t mean all joke hacks are like this.
Some choose to follow a more structured plot akin to a normal hack, some start simple to devolve in a real adventure, and so on.
To answer your 2nd question, it’s not uncommon for serious stories to have some comic relief (or comic relief characters) in order to let the player/viewer/reader take a breather from all the plot happening around them.
A simple example might just be filler episodes in relatively serious series;
just don’t go overboard, and know when to make a joke and when to remain serious.