Scientists have solved the mystery of sticky black balls that began washing on beaches in Sydney, Australia last month.