Even when an insect is classified as a pest, it can have, under different circumstances, a beneficial role. A fly in a house is a pest, but that same fly is beneficial in its role as a detritivore.