The ancestors of Alolans occasionally blamed themselves for the ecological catastrophes that followed their arrival in virgin lands, and more often developed an elaborate mythology based on corruption and divine curses that forced them to explore the seas. In reality, the culprit was a small, black-furred pokemon, which they unwittingly carried in their canoes en route to settlement of new islands, inevitably to escape the destruction which the Pacific Rattata had wrought upon their prior homes.
Once they reached Alola, Rattata ate the Alolan Swellow's eggs to extinction, and nearly did the same to the Oricorio. They were able to feast on ecologically naive species long enough to develop a metabolism, and an appetite, unparalleled among rodent pokemon. And once flying pokemon in Alola adapted to their presence or were eaten to extinction, Alolan Rattata were forced to find a new source of food.
Rattata are traditionally solitary pokemon, which is perhaps why Alolan authorities missed the signs of increasing cooperation which led up to the Granary Raid, and ultimately to the Great Rattata Famine. The guards – a few half-asleep soldiers with weapons, plus a Meowth or two – had been posted to deter the odd pokemon sneaking in, and were wholly outmatched by the Rattata horde which gorged themselves on the year's harvest.
After this disaster, Kahunas learned to disperse their food supplies, so that no single Rattata raid could mean famine. Some even imported Yungoos in an ill-fated effort to combat them, for while Yungoos occasionally clashed with Rattata, they also competed with them for food, leaving many Rattata no choice but to take from humans. Alola still does not produce enough food to match the seemingly infinite appetites of its Rattata population, and many a supermarket or kitchen is emptied even today by a pack of hungry Rattata.