The causes can be a trauma in life (abuse, childhood trauma, PTSD, anything really) OR nothing at all. It can just be a chemical imbalance in your brain and there you go. You develop anxiety. Again it's nothing you did or didn't do and sometimes it's easier to find a reason but often the real therapy is to not seek a reason, to just accept it for what it is: a condition that our brains cannot take care of properly unless we seek help, hence why we are here and not alone.
Food does not cause anxiety, genetics can but it's not the only cause, environment of course can (living in a war zone is not something anyone chooses for example). Infections mhmm no. I don't think so.