There are several theories mooted in the novels, but nothing conclusive. One school of thought is that they're remnants of planetary collisions and ordinary physical processes.
But even the Qeng Ho had been a little intimidated by these boulders.
Asteroids like this didn’t exist outside of theory. And although these
rocks weren’t single gems, there was a vast, crystalline order to
them. The cores of gas giants, planets blown away in some long-ago
detonation? They were just another mystery of the OnOff system.
A Deepness in the Sky
Later on there's a hint of a suggestion that they might be artifacts left by an elder civilisation.
“Yes. It makes the conclusion all the more fantastic. For forty years
we’ve thought the diamond powders of Arachna were either infalls or
biological skeletons. Now it looks like they are fossil processing
devices. And at least some of them reassert their mission when brought
close together. Like localizers, but much much smaller, and with a
special purpose…to manipulate physical laws in ways we don’t begin to
understand.”
Trinli looked as if someone had punched him in the face, as if decades
of bombast had been beaten out of him. He said softly, “Nanotech. The
dream.”
“What? Yes, the Failed Dream. Till now.” The Podmaster looked up at
the tile lying on the ceiling. He smiled. “Whoever visited here, it
was millions or billions of years ago. I doubt we’ll ever find any
camp tents or garbage middens…but the signs of their technology are
everywhere.”
Vinh: “We were looking for starfarers, but we were too small and all
we saw were their ankles.” He tore his gaze down from the ceiling.
“Maybe even these—” He waved at the window, and Gonle realized that he
was talking about the big diamonds of L1. “Maybe even these are
artifacts.”
Brughel moved forward in his chair. “Nonsense. They are simple diamond
rocks.” But there was an edge of uncertainty in the aggressive look he
flashed around the table.