Peel and dice the onions. Sear them together with the diced ham. Then add the sauerkraut and a little more water (the sauerkraut should not be completely covered). Now add the bay leaves and peppercorns. Peel and grate a large potato and add it to the sauerkraut. Let the whole thing simmer for a good 2 - 2.5 hours at a low temperature. Stir regularly, because the potato will make it creamy. If necessary, add a little more water. If the sauerkraut is too sour, add a little sugar and season with granular broth at the end.
I had smoked pork and potatoes with it.
Tips: Cook the sauerkraut the day before so that it can steep overnight. Boil and freeze a larger portion.