According to the screenshot below, background applications have a lower download and upload speed:
The screenshot says:
Keep the app open for getting the best and upload speed.
How can I avoid that?
I use Android 10 with Samsung Galaxy S9.
The notification "Keep the app open for taking the best and upload speed" is most likely shown by the app as there are a few known problems when apps running in background that could make the download stop so that the app has to resume (or even restart it if the server does not support resume) it which of course makes the download slower.
The main reason for the different behavior between running in foreground compared to running in background is the battery optimization applied by Android.
As Android is open source phone manufacturer have the possibility to apply modifications to those parts of Android Google does not covered by it's certification. Some years ago phone manufacturer have started to implement additional "battery saving" mechanisms to reduce CPU usage of apps in background (as far as I remember Huawei was one of the first, the other followed). The term "battery optimization" is a brightened description of "app killing when they are in background no matter if the user wants it to run or not".
Of course from a user perspective an app that just stops does not work correctly and thus the app developers have tried to find workarounds for this problem. But as every manufacturer implements the background app killing in a different way developing an app that runs in background can get pretty complicated depending on the phone used. A very good summary of the whole app killing problem can be found on Don't kill my app!. There an experienced app developer has collected information on which manufacturer and android versions affect apps in background in what way and how to deal with this situation.
So as a conclusion: The shown notification is in my interpretation just a suggestion by the app developer to avoid problems. An app running in foreground is usually not affected by those "battery optimizations" and thus can download the file in a nnormal way.
Q & A