The basic international laws covering neutral territories is the Second Hague Convention.
Other countries may be more active on the international stage, but emphasizing an intention to remain neutral in case of war proximate to the country. By such a declaration of intentions, the country hopes that all beligerents will count on the country's territory as off limits for the enemy, and hence unneccessary to waste resources on.
Many countries occupied during World War II had tried this way, and in the end only Ireland, Sweden and Switzerland were successful — though Éire supplied some important secret information to the Allies, for instance was the date of D-Day decided on the basis of incoming Atlantic weather information supplied from Ireland, while Sweden and Switzerland, as embedded within Nazi-Germany and her associates, made some concessions to Nazi requests.
See also: Non-Aligned Movement