dotnet pack
– Produces a NuGet package of your code.
That is the key difference – this will enable to publish to http://nuget.org, or to a nuget server that can be pulled down by other developers, or even for use with Octopus Deploy.
dotnet publish
– Produces a .NET framework-dependent or self-contained application.
Keyword is “self-contained”, a installer perhaps, or a folder that can be deployed by copying/pasting between hosts.