Generally there are 2 types of zoom lenses.
Parfocal - lens says in focus while zooming in & out
Varifocal - lens needs to be refocused while zooming in & out.
Parfocal is way more expensive. The 2 ways to achieve a parfocal that I know of.
1. Mechanically using cams inside the lens barrel to move focus element(s) while zooming
2. Software - using motors, you can adjust focus as a function of zoom to stay in focus. Sony's SCL Zooms are parfocal, electronically (not autofocus).
Most, if not all security cameras (& dslrs) are varifocal. Generally you use huge depth of focus or autofocus on these cameras.
I've only seen (mechanical) parafocal lenses in the $10K - $200K pricerange, for cinema/TV use.