Maybe it isn't showing you the truck at all, maybe it is just messing with you!UPS now has a map that lets you see the final delivery truck's location. Of course, if you don't know it's route, it can drive you nuts coming close and them going away again.
Actually, they have invested heavily in route planning software. The software tries to minimize the cost of delivery. I recall that one of the things that he software does is minimize left turns as the truck can spend extra time idling while waiting to make the turn. So the truck could pass by your house in one direction but not stop because it would require a left turn into the drive and instead make the delivery as the truck goes the opposite direction on the street.