Heat the olive oil or butter in a large skillet over medium-low heat.
Add the thinly sliced shallots and cook, stirring frequently, until they are soft and translucent, about 8 to 10 minutes.
Add the minced garlic and sauté for about 30 seconds until fragrant.
Pour in the green beans, soy sauce, salt, pepper, and the 1/2 cup water and bring to a boil.
Reduce heat to low, cover the skillet, and simmer the green beans until tender about 8 minutes.
Remove the lid and increase heat to medium-high; cook, stirring frequently, until the liquid evaporates and the green beans are tender and the shallots are jammy, about 5 to 6 minutes more.
Taste and adjust seasoning with additional salt and pepper if needed, then serve warm.