I think lots of people are being incredibly unfair and uncaring on this thread.
Too many people are quick to assume that people who take their own food might be 'weird' or 'judgy' or 'rude', but does it not occur to you that other things might be going on?
I have an anxiety disorder, which includes emetophobia. In line with this, I will NOT eat things that other people cook. This isn't because I think they're crap cooks or they cook in a dirty kitchen, but more that I haven't physically seen how the food has been prepared, therefore I cannot be sure that it's 'safe'.
I have never thought of bringing my own food to things. Instead, I opt to just make my excuses and not go. My family all hate me and think I'm rude for this, without knowing the daily battle that goes on in my head.
Or, they may have complex allergies that you're not aware of.
They could also have an eating disorder, and have to control carefully what they eat. Eating in front of you at all will be very difficult, but eating food that they've prepared will at least make things a little bit easier.
There are so many reasons.
You can usually tell if someone is doing it and turning their nose up at you, in their manner.
If these people are usually good friends/family and you get on well, I would quietly assume that there is something going on that you don't know about, and simply welcome them into your home with open arms and a caring heart. They probably need it the most out of anyone there.