Heat 2 tablespoons of the olive oil in each of 2 large skillets. Add half of the onions to each skillet and cook over moderately low heat for 1 hour, stirring occasionally, or until nicely browned. Scrape all of the onions into 1 skillet. Stir in the sherry and caraway seeds and cook until the sherry is completely absorbed, about 1 minute. Season with salt and pepper.