In a large pot, heat the olive oil over medium heat. Add the onion, garlic, carrots, 1 teaspoon salt, 1/2 teaspoon pepper, and red pepper flakes (if using) and cook until the onion is softened and translucent, about 5 minutes. Add the vegetable stock and bring to a boil. Reduce the heat, cover, and simmer until the carrots are tender when pierced with a fork, about 25 minutes. Remove from the heat and puree the soup with an immersion blender (or in batches in a regular blender).