ŚB 12.6.50
Canto 12, Chapter 6, Text 50
चतस्र: संहिताश्चक्रे मन्त्रैर्मणिगणा इव ॥ ५० ॥
rāśīr uddhṛtya vargaśaḥ
catasraḥ saṁhitāś cakre
mantrair maṇi-gaṇā iva
Word by word
ṛk-atharva-yajuḥ-sāmnām — of the Ṛg, Atharva, Yajur and Sāma Vedas; rāśīḥ — the accumulation (of mantras); uddhṛtya — separating out; vargaśaḥ — in specific categories; catasraḥ — four; saṁhitāḥ — collections; cakre — he made; mantraiḥ — with the mantras; maṇi-gaṇāḥ — gems; iva — just as.
Translation
Śrīla Vyāsadeva separated the mantras of the Ṛg, Atharva, Yajur and Sāma Vedas into four divisions, just as one sorts out a mixed collection of jewels into piles. Thus he composed four distinct Vedic literatures.
Purport
When Lord Brahmā first spoke the four Vedas with his four mouths, the mantras were mixed together like an unsorted collection of various types of jewels. Śrīla Vyāsadeva sorted the Vedic mantras into four divisions (saṁhitās), which thus became the recognizable Ṛg, Atharva, Yajur and Sāma Vedas.