The atoms of like characteristics were said to unite into binaries, each of which thereby produced a new substance (called samavāya).
These binaries in turn unite into triads, from which everything is made.
In this system, God is the omniscient entity that puts together the atoms in all these configurations to make the universe