The Canadian linguistic quirk of putting "eh" at the end of a sentence is an example of a tag, which is a word or phrase appended to a sentence. In Mandarin, any statement appended with "ma" turns that statement into a question. In English, the tag "isn't it?" provokes a response of agreement or disagreement. As a tag, "eh" is more universal and flexible. It can be used for just about anything.
There are a few major ways a Canadian could use “eh.” The first is while stating an opinion: “It’s a nice day, eh?” Another would be as an exclamation tag, which is added to a sentence in order to indicate surprise: “What a game, eh?” Or you could use it for a request or command: “Put it over here, eh?” And then there’s the odd example of using it within a criticism: “You really messed that one up, eh?”
Jack Chambers, a linguist at the University of Toronto, writes that these “ehs” are all of a piece. “All of these uses have one pragmatic purpose in common: they all show politeness,” he wrote in a 2014 paper. Using “eh” to end the statement of an opinion or an explanation is a way for the speaker to express solidarity with the listener. It’s not exactly asking for reassurance or confirmation, but it’s not far off: the speaker is basically saying, hey, we’re on the same page here, we agree on this.
Even in the use of “eh” as a criticism or a command, the word seeks to find common ground. If I say “you’re an idiot, eh?”, what I’m saying is, you’re an idiot, but you should also think you’re an idiot, and our understanding of you as an idiot finds us on common ground.