Looks like a concretion whereby water has infiltrated a ground system and the materials in the water have settled and compacted into a rock. This happens wherever water runs from rivers, to forests to glaciers. Holes are caused by biological materials wearing away, decaying and such or softer materials in the rock wearing away. Even air pockets not filled by the sediments can cause holes. In a forest, especially after a rain. many new things are revealed. I suspect ground traffic and vehicles can dislodge them. Beasties can dislodge them looking for food.. if it is slag, that would be metal. Basically waste product from metal. Should be magnetic if it is slag.