Former Home Depot lumber associate Jack McCleary wrote on Quora that the chain's "wood comes from wherever they can get the best price."
He added that, "Pressure-treated lumber comes from different vendors depending on area, but all vendors compete to buy from mills in the Pacific Northwest and Canada."
So Ace Hardware and Lowe's end up getting their lumber from the same mills.
McCleary wrote that whitewood typically comes from Canada, sheathing and plywood is typically from "nearby lumber mills," common boards are usually from Sweden, and hardwood plywood generally comes from South America.
If you're looking to just buy scrap wood, that's an option, too. Damaged "cull lumber" is up for sale, and it's usually located near the lumber saws, according to former Home Depot department supervisor Kristina Cornett's Quora post.
"The cut pieces usually have a spray-painted dot in different colors depending on their price point," Cornett wrote. "I can't remember the actual pricing, but I'd say it ranges from $2 to $10. Ask the store associates for pricing in lumber and building materials. Otherwise the cashiers can look it up on the registers."