Add the beans to a large bowl and cover with 3 inches of water. Soak the beans for at least 8 hours or up to overnight. Drain and rinse well.
In a large pot, heat the olive oil over medium heat. Once the oil is glistening, add the onions and cook, stirring often, until softened, 3 to 4 minutes.
Add the beans to the pot and cover with 3 inches of water. Increase the heat to high and bring to a boil. Reduce the heat to low and simmer until the beans begin to foam, about 30 minutes. Skim the foam off the top using a fine mesh strainer.
Add the bay leaves, thyme, garlic cloves, salt, and pepper. Simmer, stirring occasionally, until beans are tender, about another 2 hours.
InstantPot Method:
Add the beans to a large bowl and cover with 3 inches of water. Soak the beans for at least 8 hours or up to overnight. Drain and rinse well.
Add the beans to the InstantPot and cover with 1-inch of water. Add the bay leaves, thyme, garlic, salt, and pepper. Secure the lid, close the vent valve, and cook on high pressure for 12 minutes.
Let the pressure release naturally for 5 to 10 minutes, then manually release the remaining steam.