Preheat your oven to 350°F (175°C). Grease an 8x8 inch baking dish with some butter to prevent sticking. In a medium saucepan, add the canned yams along with their liquid and bring to a boil. Once boiling, reduce the heat and simmer until the sweet potatoes are fork-tender. Drain the sweet potatoes and transfer them to a large bowl.
Mash the drained sweet potatoes until smooth. Add granulated sugar, butter, milk, eggs, and vanilla extract to the bowl. Mix well until the ingredients are fully incorporated and the mixture is smooth and creamy. This makes for a wonderfully silky filling—I like to mash until almost no lumps remain.
Spread the sweet potato mixture evenly into the prepared, greased baking dish. Set aside while you prepare the pecan topping.
In a separate bowl, combine pecan pieces, packed brown sugar, all-purpose flour, and melted unsalted butter. Mix well until the topping is evenly moistened and crumbly.
Sprinkle the pecan topping evenly over the sweet potato mixture in the baking dish. Bake in the preheated oven for 45 minutes, or until the topping is golden brown and the filling is set. For a sweet finishing touch, I like to add mini marshmallows during the last 5 minutes of baking—just sprinkle them on top and let them get toasty.
Let the casserole cool for at least 15 minutes before serving. This allows the filling to set and makes it easier to cut and serve. Enjoy!