The mythology story behind this: Lord Shiva, Goddess Parvati, and Lord Ganesha once visited Rishi Atri and his wife Anusuya. Anusuya said that she will serve Lord Shiva only after she satiates Lord Ganesha's hunger. Despite many delicacies, Lord Ganesha's hunger was not satisfied. That is when Anusuya fed him a sweet and Ganesha burped showing he was satisfied. Hearing his burp, Lord Shiva burped 21 times indicating he was satisfied too. Parvati then asked Anusuya about the sweet and learned that it was modaka that satisfied Ganesha's hunger. Goddess Parvati then wished that Lord Ganesha should be offered 21 modaks.