Make the dough: In the bowl of your large stand mixer, add the water and sprinkle the yeast on top of the water. Add 5 tablespoons of the oil and whisk together. Set aside for about 5 minutes, just to make sure the yeast is blooming.
Then add MOST of the flour (I usually start with about 5 1/2 cups) and the sea salt. Begin stirring it in on low speed with the dough hook attachment, gradually increasing the speed as the mixture comes together (about 3 minutes).
You'll need to stop it a couple times and use a rubber spatula to scrape down the sides, making sure the flour gets incorporated. As it starts to get fully stirred in, determine if you need more flour (you probably will). Add flour a quarter cup at a time with the mixer running, until you get a super sticky, wet dough. If your dough is too dry, add a tablespoon of warm water at a time to loosen it slightly.
Knead in the mixer on medium-low or on your counter by hand until the dough becomes stretchy and smoother, forming a ball. I've done both, but mixer is definitely the less messy option of the two.
Form the dough into a ball (or ball-ish, if it's too sticky) and place into a large lightly-oiled bowl. You can swish the dough around the bottom of the bowl and then flip it over so all of the dough is covered in a light film of oil.
Cover with plastic wrap and let it rise at room temperature until doubled in size (about 1-1 1/2 hours, sometimes a little longer depending on the temperature in your kitchen).
Make the topping: While the dough is rising, caramelize the onion if using it for topping (so it cools down).
In a large skillet, heat 1 tablespoon of olive oil over medium-low heat. Make sure the onions are sliced thinly, and add them to the skillet. Sprinkle with salt and (optional) a little sugar as well. Cook on medium-low for a few minutes, then turn the heat down a bit and continue to cook on low until tender and golden (anywhere from 15 to 30 minutes) but NOT truly dark caramelized. This is because they'll also cook in the oven at pretty high heat, and you don't want them charred and ashy.
If using, finely mince fresh rosemary as well.
Assemble & bake: Once the dough has doubled in size, pour oil in the bottom of a clean baking sheet & spread around.
Punch down the dough in the bowl gently, then place it in the baking sheet and gently stretch the dough to fit the pan. You want it to fill the pan completely if possible. If the dough resists, let it rest for a few minutes and try again (sometimes the dough can be moody).
Cover the dough with a piece of plastic wrap and let it rise again until doubled in size (about 40-60 minutes).
Set a rack in the lower third of the oven and preheat to 425 F.
When the dough has doubled in size, remove the plastic wrap. Dimple the surface of the risen focaccia using the first three fingertips of each hand. Gently press down into the dough in a fairly close pattern, creating deep divots.
Pour the more olive oil over the surface of the dough (don't be stingy, go with your heart!). Sprinkle on the sea salt (add the amount of salt you prefer, I definitely like focaccia saltier) and sprinkle on the chopped rosemary and caramelized onions.
Bake for 25-40 minutes, or until golden brown and puffed around the edges, with a nice crust on top (and around 200 F inside, if you have a thermometer). The reason this range is so wide is that the thickness will depend on the pan you're using, but definitely start checking at 25 minutes.
Remove from oven. Pour more olive oil over it and let sit for a few minutes. Then lift the focaccia from the pan onto a cooling rack. Ideally let it cook for at least 10-15 minutes, and the cut and serve.