Interesting bottleneck. Considering that flatpaks are basically small filesystems themselves, there's probably some redundancy to remove. I wonder if a simple de-duplication strategy at file level may be enough to fix that.
In Flatpak you define the dependencies as runtimes, and they are shared between apps. So for example when you install Kdenlive it will download the entire kde framework that is huge but when you install the next kde app it won't download it again
I genuinely can't understand how a 40 mb app can turn into a 3 gb monstrosity. I won't be able to do so even if I wanted to!
Easy: Like most other containers, it starts by bundling an entire general purpose distro. Though I grant it is surprising that the sizes are quite that bad; perhaps there were suboptimal choices made in an attempt to make the layers more reusable but it didn't work out?