This process is realized by two manners:
As a rule, 10-years-old pupils and older ones quickly build chords in right and left hand. Originally the kid makes each chord from degree I (tonic) and then chords are built in more convenient and closed location by help of teacher.
As a Result of Ja-Da Improvisation
Left hand plays bass (mode degree I-V), right one -- chords per bar part.
Scales and arpeggios both are played in different rhythms. Bass (mode degree I-V) in the left hand.
A very important moment of preparatory process to improvisation is work with a tune. Composing the tune, try to do it with expressive rhythm and melody. The same tune is performed for each bar. One may play the tune from different degree, e.g. in the first bar -- from degree III, in the second one -- from degree I and so forth.
So, step by step various versions of improvisation are come of scales, arpeggios, tunes and other musical elements during the work process. But, in principle, there is huge number of methods on composing the improvisation.