Think of 'geen' as meaning 'not a'. Using this logic, 'geen' must be used when you want to say 'I don't have a pig' - 'ik heb geen varken' - thinking of 'geen' as meaning 'not a', then this can be translated as 'I have not a pig'. But when you want to say 'I don't have the pig', you can't use 'geen' because saying 'I have not a the pig' is incorrect. So you have to use 'niet' instead, which negates the verb, the having, not the noun, the pig. So 'I don't have the pig' will be 'ik heb het varken niet' - 'I have the pig not', if you will.
In the most basic sense, Niet is for verbs and geen is used for nouns. Let me give you a senario to help: someone walks up to you and asks: "heb je het varken" (do you have the pig?)
Responding with "Ik heb het varken niet" as in this sentance is saying "I don't have the pig" so the verb is being modified, not the pig itsself. Basically, the pig exists, it's somewhere, but YOU don't have it. It could be in the barn. It could be with your brother. Who knows, but it's around somewhere.
Meanwhile if you say "ik heb geen varken... Er is geen varken" you're saying "I have no pig....there is no pig." There never was a pig. It doesn't exist, why do they want a pig? that person must be mad for thinking there's a pig.
I hope that helps!
Varken = pig
Big = young pig
Zeug = Female pig
Beer = Male pig
Varkensvlees = pork
Sure, though it can also be used to refer to a male pig (boar) (https://www.vandale.nl/gratis-woordenboek/nederlands-engels/vertaling/beer). Though without any further context it's same to assume it means bear.