For great results, finish cooking pasta in the sauce, adding a little pasta water.
In a large saucepan, heat oil and garlic over medium until fragrant. Add onion and cook, stirring occasionally, until onion is soft. Add anchovies, capers, olives, and red-pepper flakes and cook 1 minute, crushing anchovies with a spoon. Season with salt and pepper. Add tomatoes and bring to a boil. Reduce to a rapid simmer and cook until slightly thickened, 10 minutes. Season with salt and pepper. Serve with 3/4 pound cooked pasta.