Add 5 tbsp olive oil to a large pan and cook on medium high heat. Then add your sliced onions and fennel, along with the salt and black pepper and cook until soft, stirring occasionally. This should take around 5 minutes.
Once soft, reduce the temperature to medium low and continue to cook, stirring more often at this point. You want to let it cook until it's a deep golden brown hue, but you also don't want to burn, hence the low heat and frequent stirring. If you start to notice bits getting stuck to the pan, deglaze with about a tbsp of water or balsamic vinegar. (And if this becomes a recurring problem, deglaze and also reduce the temperature a little bit.) I let mine cook for about and hour and a half, but it can take anywhere from 1-2 hours. You'll know when it's done when it's nicely browned and tastes sweet and caramelized. If necessary, add more salt and pepper to taste and enjoy!