There are two kinds of foreign investment in an economy, FPI-foreign portfolio investment, in which foreign companies or persons invest their money in the share markets or shares of any company. The other type of investment is FDI, that is where a foreign company or national invest their capital directly for production or services. This comprises buying assets and running business in that country.
Basically FDI is very important for a country's economic growth, which brings foreign money into the economy, providing job opportunities, satisfying local market in low prices for a specific good. These things happens in less magnitude in FPI.
Every government is favoured towards FDI because, there is less chances of riverting back your capital if any turmoil happens in the country's economy than FPI.