Like many Western festive traditions, the custom of celebrating communion with a communion gift originated in Catholic Christianity. The word refers to the communion of the body and blood of Jesus Christ, which is conveniently replaced by bread and wine during the Eucharist.
The Eucharist commemorates the Last Supper, where Jesus broke the bread and distributed it to his apostles. Not much when you consider most first holy communion gifts nowadays! Baptised children are allowed to participate in the church ritual as soon as they reach the first grade.
To celebrate that, the family organises a communion party, which usually takes place around May-June. Six years later, the family digs deep again. This time for a gift confirmation. The anointment by the bishop symbolises the reception of the Holy Spirit. Fun fact about that: during the Middle Ages, the bishop would always give the person being anointed a good smack in the jaw along with. A communion gift is something you can feel, they must have thought, but after the Enlightenment the punch to the jaw was scratched from the ritual.
In more recent times, non-christian families started organising spring parties at the same time as the communion parties. That way, all kids can show off their communion presents the day after.