Preheat your oven to 375°F (190°C). Thinly slice the potatoes using a mandoline or sharp knife, ensuring even thickness for even cooking.
Heat a large skillet over medium heat and melt the butter. Once melted and bubbling, add the sliced onions and a pinch of salt. Cook slowly, stirring occasionally, until the onions are deeply caramelized and golden, about 20-25 minutes. They should smell sweet and have a rich color.
In a mixing bowl, whisk together the heavy cream, salt, pepper, and half of the shredded cheese until well combined.
Spread a thin layer of the creamy mixture at the bottom of a baking dish. Layer a handful of potato slices over the cream, slightly overlapping them. Repeat layering with the onions, remaining cheese, and the creamy mixture, finishing with a layer of potatoes on top.
Pour the remaining creamy mixture evenly over the layered potatoes, ensuring all slices are coated. Cover the dish with foil.
Bake in the preheated oven for 45-50 minutes, until bubbling around the edges and the potatoes are tender when pierced with a fork.
Remove the foil and sprinkle the remaining shredded cheese over the top. Return to the oven and bake uncovered for an additional 10-15 minutes, or until the top is golden brown and crispy. Your kitchen should smell rich and cheesy.
Let the scalloped potatoes rest for 5-10 minutes before serving. This helps the dish set and makes serving easier.
Serve hot and enjoy the creamy, crispy layers of caramelized onions and melted cheese in every bite.