It is based on the assumption that the <span>diplomats will obey the laws of their country of residence. They don't have to abide by laws because they have immunity that protects them from prosecution. This was introduced to make it possible for diplomats to say what they wanted against those who ruled without being prosecuted.</span>
<span>During an unrestricted submarine warfare, one of the German U-boats had sunk the British passenger ship ,the Lusitania, at great loss of life. Public outcry in the U.S. led to America declaring war on Germany.</span>
I think it was James Madison