In short: yes, police officers can clock your speed while they’re driving. They do this by using two types of radar: car-mounted units and hand-held radar units. Car-mounted units can detect another car’s speed whether the police car is stationary or moving, though hand-held units are typically reserved for when the car is sitting still.
These units emit radio waves, which are then transmitted to your car. Then, these radio waves bounce back and are analyzed by the unit’s receiver to determine your car’s speed. These radar systems aren’t perfect, but they are generally accurate.