I've been playing this game for about 14-16 years. I find people complaining about "pay-to-win." While it is part of the mechanic it doesn't define the game. You DON'T have to be on all the time. You DON'T have to pay real money ... I never have anyway. And even if you do it's no promise of a win as you can acquire Dark Matter (the ingame currency) through other endeavors.
This is a PvP environment. You have to make yourself unprofitable or others will reap the profit you leave them. Pretty simple. Have enough defenses/ships to make attacking your planet cost more than the attacker is going to take away. The game has been around for long enough that there are many online tools to use.
If you can't figure out how PvP works then perhaps you should stick to Farmville where you are safe.