Why Hamster bite me but Hamster sleep on hand sometime?

Hamsters usually bite when they are nervous or scared. It's not usually anything personal, they are just jumpy.