Something gnarly is twisted, knotty, or bent, like the gnarly branches of an old apple tree or the gnarly fingers of an elderly person.
"Gnarled and knotted" is the original meaning of this adjective, from the Middle English knar, "knob, knot, or mass." Confusingly, though, it's just as commonly used in two other (completely opposite) ways, to mean both "difficult" and "wonderful." In the 1970s, North American surfers adopted gnarly into their slang to describe a huge, dangerous wave. Later it came to mean "awesome," as in: "Listen to this gnarly guitar solo!"