When the squirrels get overpopulated, there's a sudden increase in hawks, owls, foxes and coyotes. All in balance
Porcupines don't fire their quills--they use their tails to bat at an enemy. They can whap pretty hard, which imbeds the quills deeply. The quills do detach from the porcupine pretty easily, though, so even a gentle touch might dislodge one from the animal. But they don't propel them, except by tail power. The dog has to be close enough to be whapped by the tail or to get a mouth on the animal to get quilled. Some dogs just sniff and leave safely. Some get quilled once and learn a lesson. And then there are others who just seem to get madder every time they get quilled and keep going back for more!
Unfortunately for the last group, porkies tend to be pretty slow moving on the ground and look like easy targets.
They feed on buds. The one in the pic was budding on the young shoots of an oak tree, but they eat a lot of different types of buds. Fun to watch them--they eat so delicately!