The conjunction <em>But</em> has the purpose of introducing an additional information that is different from what was said before, which is a contrasting idea. In the first sentence, the word tricky means a <em>difficult activity,</em> and the second affirms that <em>despite the difficulty, it is </em><em>worthwhile. </em> Two contrasting ideas united by the conjunction<em> but</em>.
The author might create tension in a story to give the reader that feeling that something is going to jump out or just to give us a feeling of worry for a character.