Visual Studio 'packages' element is not declared warning

what exactly does changing <packages> to <packages xmlns="urn:packages"> in the packages.config file do, and are there any risks or downsides to doing this?

Using <packages xmlns="urn:packages"> in the packages.config file adds the schema to the file. The xmlns (namespace) declaration is nothing more than a string in the form of a uniform resource identifier (URI) and this declaration is not required. NuGet uses the <packages> node in packages.config to restore project dependencies as is described in the Schema section of the packages.config reference. This is why Microsoft used <packages> instead of <packages xmlns="urn:packages">.

The packages.config file is auto-generated and can be used by NuGet as-is. There is no need to change the file and there no risks or downsides associated with ignoring the warning.