It is basically a telescope, with cross hairs like a gun scope. You point at the target and the transit(old school), theodolite(slightly less old) or Total Station (latest device) measures horizontal and vertical angles. With those angles you can determine the direction to an object.
The Total Station can also measure the distance to the object. It emits a calibrated light wave and times how long it takes for the light to travel a round trip. It leaves the TS, bounces off the object and returns to the TS. By knowing the speed of the specific type of light it can calculate the distance. And it does it very precisely, down to thousandths of a foot. It is actually measuring distances with time!
Stop in our office and you can look through one.
Mikeeee