They start with dogs bred to be highly intelligent and responsive to a handler.
Then those dogs are raised to be highly socialized and to be able to focus on their handler/chosen reward.
THEN they are trained using balanced methods so that the puppy believes that it cannot disobey successfully (i.e. the reward they were disobeying to get is removed when they try, or the puppy is physically blocked/stopped, or the dog gets a correction) and that obedience is highly rewarded with the stuff they love best.
A dog doesn’t get to do the “bite” game (which they have been bred socialized conditioned and trained to think of as the greatest reward ever) unless they obey.