>>40193167 (I'm the guy that made the comment)
But it's rather complicated to explain it.
Sometimes it is completely artificial and made up like "national identity" of ex colonies (like US, Australia, Nigeria, Mexico, Brazil etc).
Sometimes it is based on religion like Israel where numerous Jewish groups (Ashkenazi, Sephardim, Mizrahi, Ethiopian Jews), who belonged to different ethnic groups, spoke different languages, and had different religious traditions were merged into one single nation. Similar case is the Pakistan.
Some nations derived from uniting similar regional ethnic groups that live in one broader region like Italy, Germany, Spain. Yugoslavia was a failed attempt to do the same.
Some nations are purely ethnic based like Slovenia or Denmark.
Some of them don't have their own countries Basque nation, native American nations etc.
There are also broader nations created from merging two or more different nations like Britain or Belgium.
You also have to include the influence of ruling classes- the elites in creation of national identity. Sometimes the trigger can be the foreign occupation or slavery like Haiti or African-American identity.
Sometimes is the mix of many different factors.
Nations are in the same artificial and not artificial.
It's too complex to explain them