Nationalism, in a sense, is wanting to put the interests of one's own country over those of others. Such sentiments are, I would argue, borne from wanting a sense of belonging (part of Maslow's hierarchy of needs), which is, more often than not, provided amongst people who live in the same country as you do by sharing common culture, birthplace, country, and language.
As for feeling superior over other nations... yes, unfortunately extreme nationalism can lead to jingoism/chauvinism, which isn't something I advocate as such sentiments have led to devastating wars. But extremism isn't healthy in any ideology anyways.
Lastly, I think it's important to separate nationalism and racism, which I think are two different ideas that are conflated too often, although there are some instances of overlap.