http://en.wikipedia.org/wiki/Copyright#Public_domain
Here's a concrete example. Someone wrote a very successful book and it is protected by copyright laws. You may reproduce sections of it, but not the whole book. After X years have passed, and the book has passed into the public domain, you may reproduce it in full. You may not alter the work to credit yourself as the author.
Similarly, the crux of the matter is: does the Google version of the Java API constitute a derivative work that is significantly different from the Sun-Oracle version? As stated above, the UK and US do not recognize common law of copyright. So despite the fact that the Sun-Oracle APIs are publicly available, it does not allow Google to claim that the code that belonged to Sun-Oracle is free from restrictions and thus can be copied.