What made these holes in my 2x4 stud?
Those appear to be some sort of insect-related holes that were almost certainly there when the board was sawn.  I'm sure they are long gone as the kiln-drying or other processing will kill any bugs in the wood.