Many dog trainers use painful electrical shocks to teach dogs not to do unwanted behaviors. Indeed, dogs learn quickly to not jump up on people when their e-collar zaps them as they start to jump up.
Aside from my serious ethical problem with using pain to teach basic manners, dogs don’t actually learn longterm from pain delivery devices. They do learn quickly but that lesson quickly fades without ongoing reinforcement from those devices.
That’s why those dog trainers tell you to always keep those collars on. If it was real learning, the dog would eventually no longer need to wear the shock collar because he would have learned not to do that behavior!
Real lifelong learning can take longer initially. But not only does it last a lot longer than pain-based training, it genuinely builds the relationship bond your pet has with you like nothing else.