Melt butter in a large pot over medium heat. Cook and stir onion and garlic in hot butter until onion is translucent, 5 to 7 minutes.
Stir potatoes, chicken stock, and milk with the onion mixture; season with salt and pepper. Bring the liquid to a boil, reduce heat to low, and cook at a simmer until potatoes are tender and falling apart, 30 to 45 minutes.
Mash potatoes lightly to help thicken the soup, while keeping some chunks in the soup. Remove pot from heat and stir cheese into the soup to melt.