Heat the olive oil in a large skillet or Dutch oven over medium heat. Once hot, add the onion, celery, carrot, and garlic. Season with salt and pepper.
Cook, stirring occasionally, until the vegetables have softened, about 10 minutes.
Add the chard, kale, and water to the pan. Cook, stirring continuously, until the greens have wilted, about 5 minutes.
Add the tomatoes, increase the heat, and simmer for about 5 minutes.
Add the beans and stir. Add the parsley, thyme, and oregano, then stir again. Simmer for another 3 minutes or so.
Preheat the oven to 375°F.
With a potato masher, coarsely mash about one-third of the beans in the pot. Season with salt, then transfer the mixture to a 2-quart baking dish.
Cover, place in the oven, and bake for 45 minutes.
Uncover and bake for an additional 15 minutes.