Dubbing is easy. Dubs are supposed to use mouth movements as keys, so as to make it easier to follow. As such, delivery, meanings, and words change. TV Tropes calls it Lip Lock. Badly done dubs don't follow the lip movement, resulting in "Cat Talk" (Phrased used to describe older badly dubbed Kung Fu movies, where the characters move their lips longer than the dubbed words). TV Tropes call it Hong Kong Dub.
Straight subtitles or captions have less to contend with. They aren't constrained by lip movement like dubs, so the translations can be closer to the original meaning. The key word is meaning though. Purely mechanical translations, like you would get from google translate, would be pretty bad. Meaning is more important than the words used, as you are conveying a thought. Jokes are especially hard as sometimes they are regional or cultural in nature. Would a joke about how awful a brooklyn accent is be as funny to someone that has no idea what a brooklyn accent sounds like?
Recently some American movies have gotten bad subtitle translations in their foreign release.
Those of you who have seen Guardians of the Galaxy know that people like to put down Rocket by calling him a "weasel" or a "rodent." Unfortunately, the fact that these are insults was completely lost on those responsible for the translation, and therefore each time were replaced by "small raccoon" - a phase that's much more factual than mean.
Which comes to one of the biggest issues in translations. It's often Non-Native speakers (of one of the languages) that are translating it. Even bilingual people have a hard time translating from one language to the other, because meanings change.