No, I don't think it's important. What's important is that the partner has compassion and understanding. People who have struggled may have reacted to it differently, developing different personality traits. Some of them become more understanding while others get so wrapped up in their own problems that they're unable to see those of others. And so even similar struggles are not always an indication of a compassionate attitude.
Also, I'm not sure if I've ever truly known people who've never had to struggle. We all get our share of hardships in the end. Such people may exist, but they're rare. And since people adapt to their environment, any changes to it can cause a crisis. First world problems still do feel like problems, even if from one perspective they're not problems at all, so I imagine even the very affluent would say they've had to struggle. The important thing is that we both are capable of understanding each other's pains as valid, even if we come from different backgrounds. Sometimes cultural or class distinctions make this difficult.
Generational differences may play some role, but they're more about the changing values in a society rather than different struggles. There's of course correlation between the two, possibly causation as well. It's a slow process and usually the age gap in a relationship isn't so big that it would make a difference. And even then values are highly individual, so the effect of age is rather just a tendency to think in a certain way about some things like sexuality or the job market.