Khums division origin:-
From verse 8:41 apparently. And there are some traditions which show at the time of Holy Prophet and Imams it was given to family.
Based on the verse it is divided in 3 & 3.
The division in the Quran:-
Khums is for God and His messenger and dhilqurba....then the other 3 categories of yateem and miskeen, etc