Preheat oven to 325°.
Place ham on a parchment-lined baking sheet and bake until crisp, about 20–25 minutes; let cool and break into pieces.
Combine the breadcrumbs and 2 tbsp. of oil in a medium sauté pan and toast over medium heat, tossing occasionally, until golden brown, about 10–15 minutes. Remove from heat. Add thyme and 1/4 cup Parmesan; season with salt and pepper. Mix in ham and set aside.
Cook the collard greens in a large pot of boiling, salted water until slightly tender and still bright green, about 7–10 minutes. Drain and rinse with cold water until cool. Let drain a couple more minutes, then squeeze them as dry as possible with paper towels.
Heat remaining 2 tbsp. oil in a medium saucepan over medium heat. Add onion and garlic and cook, stirring often, until softened and golden, about 15–20 minutes. Transfer to bowl with greens; set aside. Reserve saucepan.
Increase oven temperature to 400°.
Melt the butter in the reserved saucepan over medium heat. Add flour and cook, whisking constantly, until mixture is smooth and very pale brown, about 4 minutes. Gradually whisk in milk, a little at a time; add the nutmeg. Bring to a boil, reduce heat, and stir in the cheese, stirring until smooth and the sauce thickens. Whisk in remaining Calvander or Parmesan. You have just made a Mornay sauce. Pour about half the sauce into the collard green mixture and stir to combine. Add enough sauce to give the collards body – you may not use all of the sauce. Transfer collard green mixture to a 10-inch castiron skillet, large casserole dish, or 9-inch, deep-dish pie plate. Top with breadcrumb mixture; place on a rimmed baking sheet and bake until gratin is bubbling, about 15–20 minutes. Let cool slightly at least 5–10 minutes before serving.