Melt butter in a Dutch oven over medium-high heat. Add onion and garlic; sauté 5 minutes or until onion is tender. Combine milk, salt, pepper, and flour, stirring with a whisk. Add milk mixture to pan. Bring to a simmer; cook until slightly thick (about 2 minutes), stirring frequently. Add 4 ounces cheese and ham, stirring until cheese melts. Stir in potatoes.