Dual H-Bridge

i need to know why when the two pins of en1 or en2 if the capsule is in place gives maximum speed , and which pin to connect with a PWM arduino pin and why ? what is the function of the internal 5v regulator chip above the input pins of H-Bridge and what happens too why the 5v enable pins when it's in placed it output 5v and when not it input 5 volt ?

The L293D H Bridge ?

The chip contains 2 identical circuits, each with 2 input pins and one enable pin. It is the enable pin to which the PWM signal is connected.

Google for a circuit diagram which matches what you are trying to do.

i think you are asking about L298N

type to google "L298N tutorial"

https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/

also

https://electronicshobbyists.com/controlling-dc-motors-arduino-arduino-l298n-tutorial/

The L298N H bridge module

HassanBosha20: The L298N H bridge module

Which one. There are lots of different ones, and all they have in common is the 298 chip. The ancilliary electronics and jumpers etc differs from module to module.

The "How to use this forum" post gives excellent hints on how to ask sensible questions. Please read it and follow the directions.