Pick through the beans, discarding any debris or stones, rinse the beans thoroughly in cold water, and drain.
Place beans, ham hock, and 2 quarts cold water in a large stockpot or Dutch oven. Stir in baking soda, bay leaves, carrots, and diced celery. Bring the soup to a boil, then reduce heat to simmer, and partially cover the pot.
Simmer until beans are tender; begin to check for tenderness at about 1 1/2 hours. If beans are not tender, continue to simmer, partially covered, until soft, checking every 30 minutes or so.
Remove ham hock to a work surface and allow to cool slightly, until it can be handled comfortably. Pick the meat from the bones, remove any membranes or skin, shred the meat and return to the pot.
The soup should be thick and creamy. If soup seems dry, add water until your desired consistency is achieved.
While beans are cooking, melt butter in a skillet over medium heat. Add diced yellow onion and cook, stirring frequently, until soft and nearly clear, about 5 minutes. Set aside.
Before serving, stir in buttery onions, taste the soup, and season with kosher salt and black pepper. Ladle into serving bowls and serve warm.