While each factions' population on a planet can affect the amount that you're attacked, you should consider whether your base layout is contributing to the resources you're losing.
For instance, some players leave their resource buildings undefended on the outside of their base. This set-up may be effective enough to successfully defend against attacks, so instead of receiving protection, you'll receive medals. However, this leaves your resources undefended, allowing more players to continually drain them. Even players who know they can't defeat you, might attack in order to steal resources.
To prevent this from happening, try spreading out your resource buildings and defending them heavily. Once you've done this, you'll begin holding onto a lot more resources.