Package dependencies
Dependency loading varies depending on whether the extension is running in BPS Service or BPS Portal.
BPS Serwis
Extenion runs in Service when it is used on cyclical action, on timer or on transition path which was triggered by Service. BPS Service is written in .NET Framework 4.7.2 so in this environment, you have to provide in package all dependecies that are not system.
BPS Portal
Extenion runs in Portal e.g. when it is used on menu button or on transition path which was triggered by user in Portal. BPS Portal is written in .NET 8 so in this environment, you have to provide in package dependecies that are not in .NET 8 runtime.
How to get correct dependencies for runtime
If all the dependencies you are using are properly implemented in .net standard 2.0 then you just need to add them to the dependencies node in the package manifest. But if you cannot get dependencies implemented in .net standard 2.0 then you can use serviceDependencies and portalDependencies.
To get dlls implemented in .NET Framework and .NET 8 you can create separate project targeting this frameworks and get dependencies from their output.