Use a spice grinder to combine the fennel seed and chili flakes.
In a large skillet over medium heat, heat 1 tablespoon of olive oil. Add the fennel seed and chili flake mixture and minced garlic to the oil and stir to combine for about a minute.
Add the onions and salt to the skillet. Cook, stirring frequently for about 5 minutes, until the onions are soft.
Add the capers and the tomatoes with their juice to the skillet. After the mixture reaches a simmer, reduce the heat to medium-low and cook for 15 minutes, stirring occasionally and breaking up large pieces of tomato.
While that cooks, preheat the oven to 375º. Grease a 3 quart casserole dish with olive oil.
In a saucepan, combine 4 cups of water, garlic powder and a sprinkle of black pepper. Bring to a boil.
Reduce the temperature to medium and add the polenta in a slow, steady stream, whisking constantly. Continue to whisk until the polenta is thick (normal polenta consistency, this takes a few minutes). Whisk in 1/2 cup of cold water and return the polenta to bubbling.
Stir in a 1/2 cup of the mozzarella cheese to the polenta. Next, pour the polenta into the greased casserole dish. Distribute the polenta evenly in the dish. Pour the onion and tomato mixture on top and cover with the remaining mozzarella.
Bake for 20 minutes and cool before serving.