because they aren't people 99% of the time, it's a computer program. It'll keep attempting, and if you do engage it will switch over to a real person once they have someone hooked.
They even have ones that garner attention, like shuffling noises, saying "Oh I'm sorry, hang on a second" and other gimics to keep you on the line and start engaging. You'd be surprised at how many people will say "Oh sure" out of politeness.
As for cost, to run a virtual machine in the cloud running 24/7 trying all the numbers one by one in the database would cost... pennies. We're talking probably less than 5 bucks a month.