Melt the butter in a large saucepan. Add the onions, cover and cook over moderately low heat, stirring occasionally, until softened, about 15 minutes. Uncover, add the sugar and cook, stirring frequently, until very tender and lightly browned, 10 to 15 minutes. Stir in the raisins, vinegar and Campari and season with salt and pepper. Cook over moderately low heat until most of the liquid evaporates, about 10 minutes. Transfer the relish to a bowl and let cool completely. Serve at room temperature.