Not all thieves can defeat all locks. If a thief has a car jack, he will be unable to break a chain or cable lock. A thief with bolt cutters may not be able to defeat a u-lock. Bigger and harder locks require heftier equipment to defeat. In any event, even if a thief can break it, a lock may slow him down long enough to get caught or may make him decide to steal someone else's bike.
Using a hardware store chain and cheap padlock may stop the neighborhood kid. But a cheap pair of bolt cutters will slice through the chain with no difficulty. However, it may be perfectly adequate if the threat where you lock your bike is comprised of opportunist kids who are looking something they can simply ride away.