It’s oil and possibly even packing in a little ‘meat’ from the nut to fill in the groove of small scratches. Oil absorbs and darkens in the scratch, hiding it. If the furniture has a really dark stain, it might not match, but if it was closer to just a good sealer on natural wood color then the walnut oil should generate a very similar shade.
Walnut oil doesn’t go ‘rancid’ as it oxidizes over time either.
You might want to lightly buff with a microfiber cloth after letting it sit a day or so. But the fix should hold up visually at least for quite a while.
They sell sealers that are mixes of carnuba wax and walnut oil for things like soapstone and cutting boards (food safe). I use one after lasering on slate coasters for better contrast pop of the resulting pattern. But for easy one step scratch fix, nothing beats a plain old shelled raw walnut.
Latest Answers