Heat oil in a large soup pot. Add onions and cook over high heat, stirring often, until onions are well-browned. This takes about 40 minutes. If the onions get a little stuck on the bottom, just stir them. You want the onions to be nicely browned, not burned.
Add garlic, salt, and white pepper and cook for five minutes more. Add the sweet potatoes and water or stock. Bring to a boil and then simmer for 40 minutes, or until the potatoes are soft. Cool slightly.
Purée the soup, using an immersion blender, or in batches in a food processor, until it is completely smooth. If using an immersion blender, purée for three full minutes. Taste for seasonings and add salt or white pepper as needed.