Foreign entity is also called transact business other than your state or country. For example, Your business is registered in New York and want to open an office in New Jersey. To transact business in NJ you need to register your New York entity in the State of New Jersey to conduct business in the state of New Jersey as a foreign entity.
OR If you are located in Canada and want to extend your business to USA then you should form a foreign entity in USA. To form foreign entity some states in USA may ask you to provide Certificate of Good Standing of your existing business.