Answer is pretty simple. Before executing any query first sql server checks the cached plan if it doesn't find the query in it then it compiles the query and adds in cached plan otherwise directly execute the query. Now we are going to check the cached plan. Before this it would be good first empty the cached plan:
--To empty cached Query Plan
DBCC FREEPROCCACHE
Now we are executing the first query:
SELECT DISTINCT MsgId * Severity, Msg
FROM SqlMessage
WHERE MsgId > 1