Either you get it from pills yourself, or (if not vegan) the animals will be injected with it. Either way, there is no perfect solution to fill up your B12 needs
That's only true for anti biotics infested farm animals though. Either way if you go for a vegan diet you have to keep up with B12. Don't fall for the naturalistic fallacy ("if I eat fresh and 'natural' it will all be fine").