Law enforcement's ability to depends on "exploits," hacker tricks that take advantage of vulnerabilities in the phones' operating systems. Many exploits are kept quiet, to be sold to criminals or security companies. Others leak out. Here's a list of some of the known cracks in the security of the two major types of smartphone.
Brute force attack: : The most direct way past a password is to throw a lot of guesses at it. If you're using Apple's basic four-digit PIN, it'll take no more than 10,000 guesses. That's a lot of guesses to enter by thumb; it's child's play for a computer. Apple for brute force attacks on its newest operating system, iOS 7, though hackers are most likely probing it for new vulnerabilities.
Jailbreaking: Widely available software like "Redsn0w" can get at the "root" system of an iPhone. Once you're in the root, you can use to make the phone cough up its PIN. But this hack can be balky and it works most reliably on older iPhones.
Your iTunes: If your iPhone is locked, police sometimes find what they need by checking the backup you made on your computer, which you may have neglected to password-protect.