Heat olive oil in a large skillet. Add onions and a pinch of salt. Cook over medium-low heat for 30–35 minutes, stirring regularly. If they start sticking, add 1–2 tbsp water at a time until the onions are deeply caramelized.
Add garlic, thyme and black pepper. Cook for 30 seconds.
Add broth, Worcestershire, Dijon and balsamic vinegar. Scrape up all the browned bits.
Stir in the butter beans and simmer for 8–10 minutes.
Mash about ¼ of the beans directly in the skillet.
Reduce the heat to low and stir in the milk, and simmer gently for 2–3 minutes.
Spread the beans into an even layer and sprinkle the Gruyère over the top.
Transfer to a 400°F oven and bake for about 8–10 minutes, until hot and bubbling.
Then switch to broil for 1–2 minutes to get that gorgeous browned, bubbly cheese crust.
Finish with fresh thyme and black pepper. Enjoy with some sourdough bread!
