8 potatoes, peeled and cut into 1/4-inch slices
1/2 cup milk
1/4 cup sour cream
1/4 cup butter
1/4 cup shredded Cheddar cheese, or to taste
1 pound ham, diced
1 pinch garlic powder, or to taste
1 pinch onion powder, or to taste
1 pinch salt and ground black pepper to taste
1/4 cup shredded Cheddar cheese
Place potatoes into a large pot and cover with salted water; bring to a boil. Reduce heat to medium-low and simmer until tender, about 20 minutes. Drain.
Preheat oven to 350 degrees F (175 degrees C). Grease a 9×13-inch baking dish.
Transfer half of the cooked potatoes to a large bowl; add milk, sour cream, butter, and 1/4 cup Cheddar cheese. Mash with a potato masher or fork until creamy.
Stir ham, garlic powder, onion powder, salt, black pepper, and remaining potato slices into the mashed potato mixture until well mixed.
Pour ham and potato mixture into prepared baking dish; sprinkle remaining 1/4 cup Cheddar cheese over mixture.
Bake in the preheated oven until cheese is melted, 20 to 30 minutes. Cool slightly before serving.