The horses I know got it from...
One got a shot and it got infected.
The other one ran into a branch during a thunderstorm and got a bad puncture wound that the vet had to 'cut' out.
They each healed fine.
My horse has a dent like that... the seller told me it was from some kind of worm that came in through his hoof, traveled up to the neck and erupted there. Not sure if I believe that, but my vet said it was only aesthetic and nothing to worry about during the PPE.