There is a story associated with this ritual. Demon named Anlasur created havoc around the world. He was so terrible that the earth would tremble by his voice and his eyes used to emit fire. He would swallow saints, sages and innocent people alive. There was terror all around. Lord Indra engaged him in battle several times and retired defeated. All the Devas request Lord Ganesh for help.
Ganesha agreed to help and transformed himself into a little boy. In order to protect the world, Lord Ganesha gobbled the demon. But, as soon as he did so, he felt the burning sensation inside him. The sensation was so strong that he couldn't bear it at all.
At that time 88,000 sages reached and each one performed archana over Sri Ganesha with 21 Durva grass each. Kashyap muni gave him 21 stacks of duvra to eat and Lord Ganesha was relieved off the suffering. Ganesha declared that henceforth, anyone worshipping him with Durva grass would be the recipient of his benevolence. Since then it is believed that offering 21 stacks of durva appeases Lord Ganesh. Lord Ganesha is offered 21 stacks of Durva, each stack consists of 21 Durvas.