Preheat oven to 350°F.
Using a Mandolin, or with a knife, slice your potatoes and onion very thin (1/8 of an inch).
Grate the Swiss cheese and separate the 1 cup and half cup.
Have your milk, flour, butter, and cheese, pepper and garlic within hands reach of your sauce pan as you will be whisking this sauce continuously to ensure a silky smooth sauce.
Melt the butter in a small sauce pan over medium heat. Add flour and stir to make a roux. Cook the roux, stirring constantly for 1-2 minutes.
Slowly add milk to the roux in small increments, stirring with a whisk until smooth between each addition. Once all of the milk has been added, bring the mixture to a low boil, stirring constantly.
Slowly add 1 cup of Swiss cheese to the sauce, stirring until melted. Add black pepper and garlic and mix into the sauce.
Remove the sauce from the heat.
Like you would do a lasagna, layer half of the potatoes in a lightly greased 9x9 casserole dish. Layer half of the onions on top, and pour half of the cheese sauce to cover the layer. Repeat layering with the same order of potatoes, onions, and sauce.
Sprinkle the remaining half cup of Swiss cheese on top.
Bake for 1 hour, or until potatoes are thoroughly cooked and cheese is golden brown and bubbly.