I upvoted @David Hedlund's answer. Allow me give you my experience of poverty and whether it was painful in any way.
As I mentioned in a comment, I grew up dirt poor. Not third world poor, but I remember when I was very young playing-with-dead-pigeons-and-seeing-a-lot-of-dead-rats kind of poor. We lived in cramped apartments, our raggedy towels all had holes in them, we wore hand-me-downs, second hand clothes, or my mother sewed our clothes. My uneducated parents worked very hard to feed us, and they never had money enough to buy us such luxuries as bicycles, etc. They lived from paycheck-to-paycheck, and my mother was deeply embarrassed when she had to supplement our store-bought food with food stamps. We bought our first TV long after friends and relatives had them.
I've established our poverty. But I never knew we were poor. I remember having great fun with a pogo stick, a hula-hoop, and with friends playing outside. I knew other people had things (like TVs and nice houses, etc.) but I never felt I was missing anything. It just was what it was, and I thought that's how things were. I knew other poor kids, and my best friend was the daughter of a well-off physician who (gasp!) had an in-ground pool in their yard. But I didn't envy them; I just thought that was the way of things; some people had much and others did not.
I believe that kids are pretty accepting of the things they experience as "normal". Most abused kids don't know until much later that they were abused. Most well-off kids don't realize what a privilege they have. Most poor kids don't know that they are poor.
I don't have a specific age group in mind, although I'd think kids would probably start to understand social differences at 5?
According to the report cited below, it's very fuzzy at 5-7, starts becoming clearer at age 8 and above. (It's just one report, and it's limited in scope, but it's from the kids' mouths themselves, and pretty instructive.)
As parents, how do we explain to kids why others have things that we do not?
It depends on your core values. If you value the truth, just tell them that some people have more money than you do. Maybe they had rich parents, good luck, work three jobs, are (insert high-paid position here). That's just how it is, and that's the truth.
As a child, my parents once told me we don't have as much money as someone else that's why we cant buy [something], and I immediately heard that as we're poor and felt terrible about it.
Why did you feel terrible? Did you feel sorry for your parents? Were you ashamed of them or yourself? If so, examine, again, your core values.
If you highly value success or material things, you might feel ashamed of not being as successful/wealthy as others. This will inform your children.
If you value honesty/integrity/kindness/resilience/work ethic/other that has nothing to do with money or what it can buy, this will also inform your children.
My (ex)husband and I are physicians, so we were not in any way materially poor, but we were very careful not to raise children who had a sense of entitlement. When the kids were very young and we watched television together (in the days before streaming), we always discussed and dissected the television commercials we saw. Did people who drank beer really have more friends? Are people who drive expensive cars better than people who ride bikes or modest cars to work? Whatever the ad was trying to hawk, we talked about society, values, appeals to vanity, etc. Material possessions did not equate to happiness or personal worth.
What we are entitled to is also a core belief that should be discussed. Are we all entitled to big houses, nice cars, or the latest gadgets? Does it mean we are less worthy people if we don't have those things?
Personally, I think we are all entitled to excellent medical care, adequate nutritious food, decent or better education, clean housing, freedom from abuse, and protection and equality under the law. There are probably other things as well, but they don't come immediately to mind. The rest, we work for. And as we work and live different lives, it's important to remember that some people who think they hit a home run through their own merits were actually born on third base, so we need not feel we have somehow failed by not working hard enough.
The impact of poverty on young children’s experience of school