Blue cheese gets its blue-green veins from Penicillium mold, usually Penicillium roqueforti, which is added to the milk or curd or grown in the cheese after it is pierced with needles. The needles let air into the interior, and the mold needs that oxygen to grow, which is why the veins spread through the cheese rather than just sitting on its surface.
The mold is safe to eat and is the source of the cheese's sharp, tangy flavor and characteristic aroma. As it grows, its enzymes break down fats and proteins in the cheese, producing the compounds that make blue cheese taste so distinctive.