As disgusting as rats may appear, they actually serve a purpose in the ecosystem. They are scavengers and opportunistic eaters. They will eat garbage and other things that people throw away. Plus, rats are important as part of the predatory ecosystem.