The answer to this question really depends on the phone in question. It may also depend upon when the passcode was created.
Most phones use the passcode for encrypting the data on a device (and of course decrypting when needed). With an iPhone, if you did not create a passcode originally and later decided to create 1 the data from prior to creating the passcode would remain in plain text on the device (unless the app maker encrypted the data themselves). Quite a bit of data on an iPhone is stored in sqlite databases which is essentially text files with a specific format.
With regards to the crackability of the passcode. Again this would depend upon the passcode. If you used the standard 4 number pin on an iPhone these are really quite trivial to brute force (a 6 digit number would be just as trivial). The difficulty in brute forcing a random password on the other hand would depend upon what characters were used and how long the password was.
There are other techniques that could be used. For example an indication on what is used for a password / passcode could be gained from fingerprints on the screen.
With the introduction of finger print technology on Android and Apple devices this also provides a different vector for gaining entry to the device. Taking a print of a users finger from a glass for example could give the person access (of course other work is necessary). Both Android and Apple devices were exploited fairly quickly when the finger print technology was introduced.
With regards to having access to the phone's memory without having the password. Yes this is certainly possible. Law enforcement do this quite regularly. A colleague of mine did his thesis on mobile security, he bought numerous phones off of eBay and used a device to connect to the phone. He was able to extract data from each without having access to the password.