Melt the butter over medium heat in a large stock pot.
Add the onions and salt to the pot and sauté for about an hour. The process of caramelizing the onions is slow. It is important to watch and stir about every 4-5 minutes. If the onions appear to be browning too quickly, turn the heat down. The onions are caramelized when they are a beautiful golden-brown color and very soft.
Add garlic and cook for another minute.
Once the onions are caramelized, add flour and stir to combine. Allow to cook for about 2-3 minutes.
Deglaze the pot with red wine, continuing to stir and scrap the bottom of the pan while stirring.
Pour the beef stock into the pot and add the black pepper and thyme. Stir to mix all ingredients.
Simmer the soup for 30 minutes.
Preheat the broiler to high.
Put 4 baking bowls or soup crocks on a sheet pan.
Fill baking bowls about 2/3 full with the onion soup.
Place about 1/2 cup of croutons in each bowl.
Layer one slice of Emmental and one slice of gruyere over the croutons of each bowl.
Carefully put sheet pan into the oven and broil for about 4-5 minutes, or until cheese is melted and bubbling on top.
Remove from the oven and allow to rest for 5 minutes before serving.