Question: Are food offerings made to the departed during various festivals and anniversaries just to express gratitude?
Answer: [i] Perhaps so, if the departed have already taken rebirth. [ii] No, if they are still around.
Question: How do they receive the offerings, if they can?
Answer: [i] For the first case, there are 3 possibilities.  If reborn as hell-beings (地狱众生), food offerings cannot be consumed as they are in a different realm and due to their heavy evil karma (恶业).  If reborn as hungry ghosts (饿鬼), animals (畜生) or humans (人), unless they come across the offerings, they cannot be consumed.  If reborn as asuras (阿修罗: demi-gods) or gods (天人), they will have no need for such offerings as they have better food with their better karma.
[ii] For the second case, there is this possibility.  If they are still around as wandering spirits (孤魂野鬼), the essence of the food will be consumed by smell.
Question: What can be done to truly benefit the departed, instead of just occasionally offering them food?
Answer: There should be practising of support-chanting (助念) as explained at https://purelanders.com/wake after offering of guidance (开示) (with appropriate tweaking of the Guidance Text) before their urns, graves, tablets and/or past homes.
Question: What will be the benefits?
Answer: [i] If the departed have already taken rebirth, the meritorious virtues (功德) created can still benefit them, by helping them to live better, and to have better rebirths more swiftly, if they were reborn in unfortunate realms. [ii] If they are around as wandering spirits, hungry ghosts or animals, hearing the guidance, they may be motivated to practise sincere mindfulness of Buddha (念佛) with you, till they see the Buddha (Āmítuófó: 阿弥陀佛), to follow him to his Pure Land (净土), where liberation (解脱) is assured.