What all affects the FOREX reserves and how?

So I read somewhere that increase in FDI increased the FOREX reserves and also that a strengthening rupee increases the reserves. Can anyone explain me the basic ideology or principle behind this