Combine breadcrumbs and 2 Tbsp. oil in a medium skillet; toast over medium heat, tossing occasionally, until golden brown and crisp, 10–15 minutes. Remove from heat and add thyme and ¼ cup Parmesan; season with salt and pepper. Mix in ham and set aside.
Cook collard greens in a large pot of boiling salted water until tender and bright green, about 4 minutes. Drain, transfer to a bowl of ice water, and let cool. Drain and squeeze dry with paper towels. Coarsely chop greens and place in a large bowl.
Heat remaining 2 Tbsp. oil in a medium saucepan over medium heat. Add onion and garlic and cook, stirring often, until softened and golden, 15–20 minutes. Transfer to bowl with greens; set aside. Reserve saucepan.
Increase oven temperature to 400°. Melt butter in 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, ½-cupful at a time; add nutmeg. Bring to a boil, reduce heat, and simmer, whisking often, until thickened, 5–8 minutes. Whisk in remaining ¾ cup Parmesan. Add béchamel to collard green mixture and mix to combine; season with salt and pepper.
Transfer collard green mixture to a 10” cast-iron skillet or 9” pie dish and top with breadcrumb mixture; place pie dish on a rimmed baking sheet. Bake until gratin is bubbling, 15–20 minutes. Let cool slightly before serving.