In a Dutch oven (or other heavy 5-quart pot with a tight-fitting lid), heat oil over medium heat. Cook onions, stirring occasionally, until soft, about 5 minutes. Add garlic; cook until fragrant, about 1 minute. Stir in eggplant and zucchini; season generously with salt and pepper.
Add 3/4 cup water; cover, and simmer until vegetables are beginning to soften, stirring once, about 5 minutes. Stir in bell peppers; simmer, covered, until softened, 5 minutes.
Stir in tomatoes and thyme; bring to a boil. Reduce heat to medium-low. Partially cover; simmer, stirring often, until vegetables are tender, 15 to 20 minutes. Remove from heat. If serving immediately, stir in basil. (If freezing, leave out basil.)
Ratatouille can be frozen in airtight containers for up to three months; reheat in the microwave or on the stove. Leave out the basil until just before serving.