The JVM has a selection of four generational GCs. Two of them are the most sophisticated GCs available anywhere.
It's not a matter of some unique brilliance. Java is simply in such high demand that it has the sufficient resources to have state of the art optimising compilers and GCs.