Children's parties were the bane of my life, both our children had various types of parties right from a very early age until teens when thankfully they took themselves off with a group of close friends and organised their own entertainment for the day.
Hurt feelings are to be avoided at all costs, I remember on one occasion I got together with another mum, our children being very close friends and we opted for an activity venue and had the whole class, although this friend did want to exclude one child who both our children had issues with. The child in question had a problematic home life, parents separated and mother had stopped him seeing his father which had affected his behaviour. I did argue that we couldn't leave him out as it would only add to the hurt he was already having to deal with. To make matters worse it would have reflected very badly on me as I took him to and from school sometimes as his mother had recently had given birth to his baby sister with her new partner. We invited him, he was very happy and the party went off well, without any incidents, although being responsible for 30 or so kids, even with half a dozen adults was not something I wanted to repeat.
Mainly our children had a circle of close friends to their parties which were often swimming or roller skating type of affairs through junior school. As HildaW has said, inviting the whole class is not always an option, it was bad enough having a dozen or so to the house when they were very young.
I do think parents should be circumspect with their invitations when they can't include everyone.