There is a strong connection between law enforcement and serving in the military. One thing that a similar is that they both fight crime or terrorists in their jobs. So they have a lot in common. Sometimes when people get out of the military, they may decide to become a police officer. They may feel that the military has prepared them for this. Also some veterans of the military had to leave the military due to injury.
They cannot pass the physical training. However they still had the physical stamina to become a police officer. So to them, this is the next best thing. That is why there are many veterans who are now police officers in America. However, sometimes, police officers come from all different walks of life.