The chemical reactions and pathways resulting in the formation of raffinose family oligosaccharides (RFOs, such as raffinose, stachyose, verbascose and other molecules with a higher degree of galactosyl polymerization).