dotnet pack - Creates a NuGet package for your code.
This is the key difference - it will allow publishing on http://nuget.org or on the Nuget server, which can be removed by other developers, or even for use with Octopus Deploy.
dotnet publish - Publish a .NET dependent or standalone application.
The keyword is βstandaloneβ, possibly an installer, or a folder that can be expanded by copying / pasting between hosts.
source share