One of the most crucial things about the GPL is that it is only triggered on distribution. You are specifically granted permission to use the software for any purpose (freedom 0). This includes embedding it in another piece of software. As long as you don't distribute the result, then you are 100% OK ("distribution" has a specific definition which is stated in the license, so refer to that if you have any questions about how that works).
The "anti-GPL hack" that some people use is that they say, "Well, if I don't distribute a library that I use, then I am not infringing on the license -- because the license only kicks in on distribution. If the user links the software, then it's 100% OK because they are specifically given permission to use the software for any purpose in the license. Whoo hoo!"
This is where the argument of "derived work" comes in. Imagine that you write a poem. I then write a critique of that poem. I don't include the poem in my critique because I don't have the right to distribute it. Just referencing your poem is not an infringement of copyright. Just because I describe your poem doesn't mean it's a derived work.
However, imagine that I decide to distribute my critique in a web page. Many of the things I say depend on the actual text of the poem, so I'd really like to add it to my text. But I can't distribute the poem. What to do? You are distributing your poem on the internet too, but you have a license that doesn't allow me to use it directly. Maybe I can be a bit clever here.
What I'll do is write a web page that deep-links to the poem. I'll write some javascript that allows the user to press a button and it will copy the text of the poem into my document. That way I can refer to the poem without actually distributing it. My document won't make any sense if the user doesn't press the button to link to the original text, but the user will be doing that, not me.
Is my website a derived work of the poem? This is a good question. I think it probably is. My document does not "work" without the original poem. It depends on the actual structure of the poem in non-trivial ways. However, I am sure there are also good arguments for the opposite. Given the outcome of Oracle vs Google where the judge decided that APIs are copyrightable, I feel fairly comfortable in my position, but as far as I know it has never been decided in court. Your guess is as good as mine (and better if you are a lawyer ;-) ).
But just to reiterate -- it does not matter how much of the program infringes. If any of the program infringes than it all infringes. You can't legally distribute it. So while it might seem weird that a very small part of your code might be deemed to be a derived work of some other code and therefore you can't distribute it -- that's how it works (and, to be honest, I can't see a reasonable way of proceeding if it didn't work that way).