When hot, add the onion and garlic, and cook until the onion is translucent, approximately 5 minutes.
Add the green chiles, cumin, green chile powder, and salt. Stir to combine and cook until fragrant, approximately 1 minute.
Add the beans and stock to the pot. Simmer over medium heat 15 minutes for the beans to soften and begin breaking down.
Mash the beans with a potato masher to your desired consistency. Add more stock or water to make it thinner and smoother. Serve warm.
For an ultra smooth bean, process the ingredients in the food processor or a blender. Add hatch chiles or anything you want whole to the beans after pureeing. Adjust the heat level by using preferred heat of chiles, more chile powder, or adding hot sauce.