| It doesn't stop|
at the water's edge
“”National security is the chief cause of national insecurity.
|—Hagbard Celine, Illuminatus!|
National security is what you call an issue when you want to be seen as heroic for refusing to compromise on it. In the past, national security was usually limited to fighting to protect your borders; these days, everything can all be considered national security issues.
In fact, a whole school of international relations has sprung up to try to convince people that we shouldn't label things national security issues.
With that said, there is usually something to the idea that each nation has a need for some kind of security. What it is that needs to be secured for that nation is usually considered a given by each individual, but actually hotly debated.
 In the United States
In the United States, national security policy has been an inchoate mess for quite awhile. After the Cold War ended, and the big bad was gone, some in the US wanted to preserve US supremacy, while others were constantly looking for the next fight to pick. After 9/11, most of the country agreed that terrorism was the biggest threat to national security, despite how little damage terrorists were actually able to do to the US state. The current policy, however, reflects that concern, and so includes killing terrorists and promoting democracy.
While the United States still has no official definition of national security more than twelve years after the invasion of Afghanistan, a generally reliable definition (on the part of the people who think it's an overriding concern) derivable from the circumstances in which the mantra is invoked is that national security is the degree to which the United States can convince itself that it can unilaterally engineer a specific outcome on a specific issue anywhere in the world. Any event that allows a non-US decision maker to access an outcome that it wants but the United States does not is considered to harm this national security.