I’m a bit confused about why AssetDatabase.ExportPackage is generating a difference UnityPackage with difference contents than I’d get if I manually exported the package via Assets → Export Package…
For reference, I’m exporting a single Scene, which has various dependencies. But the actual export is very simple, and only includes a single root asset (the scene itself).
Exporting manually, I right-click the scene, choose “Export Package…”, and I make sure that “Include Dependencies” is selected at the bottom.
When exporting via script, I’m using the following code, where the “sceneAsset” in question is the exact same Scene that I’m exporting manually:
var exportedPackageAssetList = new List<string>();
exportedPackageAssetList.Add(AssetDatabase.GetAssetPath(sceneAsset));
AssetDatabase.ExportPackage(exportedPackageAssetList.ToArray(), $"{PackageExportRoot}\\{sceneAsset.name}Package.unitypackage",
ExportPackageOptions.IncludeDependencies);
Using these two approaches, the package sizes of the two packages are different, by about a megabyte. And when I import the package generated by AssetDatabase.ExportPackage, it has a ton of additional dependencies not found in the manually exported package. All of those additional dependencies are various “Packages”. For example:

When I export manually, none of those “Packages” dependencies are included. But when I export via AssetDatabase.ExportPackage, they are included.
Does anyone know why this is, or how to prevent it? It seems really messy for a package to try to include things into Unity’s Packages directories, or mess with what’s there already.