Why do dogs behave the way they do? Is it nature or nurture? It is in fact a combination of both. Lots of factors influence behaviour including:
What a dog breed was originally bred for e.g. Australian Cattle Dogs herd by nipping heels and Shih Tzu's are bred to guard the royal palaces in China. What does this mean ? Cattle Dogs may in fact nip the kid's heels when they are running around the backyard trying to herd them into an area and Shih Tzu's may bark at visitors warning you of their arrival.
Parent's genes also play a big part. Were the parents nervous, confident, outgoing ? Was the mother relaxed and calm during pregnancy or under stress and feeling unsafe? This can influence behaviour - just as it can with children.
Next comes the critical socialisation period of 3-17 weeks. Was your puppy socialised appropriately with new dogs and people and environments, with choice to interact and build confidence in their own time? Or did your puppy have free-for-all socialisation at daycare or dog parks so he/she becomes highly aroused at the sight of other dogs? Or perhaps your puppy was under socialised and only ever met a few family dogs and people during this important time? (This certainly happened for a lot of puppies during Covid lockdown)
Puppies have fear periods right up to 18 months so if they have a bad experience that causes significant emotional, mental or physical trauma during this time, they may react around new dogs or people for years to come.
Current environment, diet, sleep, enrichment, social time, health care and exercise also play a huge part in behaviour
So much to consider when trying to understand your dog better...