In medieval times the German emperor fought under the sign of a cross - suggesting a "holy war". The color "red" was used to show his power, deciding between life and death. Christian troops tried to conquer the holy city of Jerusalem from 1000 until around 1300...
In 1291 three regions agreed to form a defence coalition in western Europe. These three cantons, called Uri, Schwyz and Unterwalden are therefore the founder states of Switzerland... leading to 20 full and 6 semi-cantons joining all together until after 1800 and forming the country. The state of Schwyz giving the name for Switzerland also gave its flag to the country... having a red ground... as they supported the emperor in earlier battles... and later receiving a cross (white).
The inversion, the red cross on white ground is the official flag of the international RED CROSS ORGANISATION, with headquarters in Switzerland.