  The four major satellites of Jupiter, known as the Galilean moons, and
Saturn's most massive satellite, Titan, are believed to have formed in a
predominantly gaseous circum-planetary disk, during the last stages of
formation of their parent planet. Pebbles from the protoplanetary disk are
blocked from flowing into the circumplanetary disk by the positive pressure
gradient at the outer edge of the planetary gap, so the gas drag assisted
capture of planetesimals should be the main contributor to the delivery of
solids onto circum-planetary disks. However, a consistent framework for the
subsequent accretion of the moons remains to be built. Here we use numerical
integrations to show that most planetesimals being captured within a
circum-planetary disk are strongly ablated due to the frictional heating they
experience, thus supplying the disk with small dust grains, whereas only a
small fraction 'survives' their capture. We then construct a simple model of a
circum-planetary disk supplied by ablation, where the flux of solids through
the disk is at equilibrium with the ablation supply rate, and investigate the
formation of moons in such disks. We show that the growth of satellites is
driven mainly by accretion of the pebbles that coagulate from the ablated
material. The pebble-accreting protosatellites rapidly migrate inward and pile
up in resonant chains at the inner edge of the circum-planetary disk. We
propose that dynamical instabilities in these resonant chains are at the origin
of the different architectures of Jupiter's and Saturn's moon systems. The
assembly of moon systems through pebble accretion can therefore be seen as a
down-scaled manifestation of the same process that forms systems of
super-Earths and terrestrial-mass planets around solar-type stars and M-dwarfs.
