What differentiates good parodies from bad ones?

If a parody involves artwork, the quality of the artwork may make or break it.

A good pastiche fits almost perfectly in the genre in question (I would consider parody a type of pastiche; “pastiche” mocks a genre, “parody” closely follows a specific work within a genre, though it can bring in elements of others).