When I read the Borg docs on pruning, one sentence stood out: repository disk space is not freed until you run borg compact. If you only ever run borg prune, the repository can stay as large as before.
The command is short:
borg compact /path/to/repo
The docs describe it as freeing repository space by compacting segments, and it is most useful after deleting archives, because only compaction really releases the space. It does not need your key, so it can be started from the client or from the server side of the repository.
A segment is only compacted when the space you would save is above a threshold, which defaults to 10 percent. You can change it with --threshold. The docs say --threshold 0 gives maximum compaction but can be much slower on large repositories, and that --threshold 1 gets nearly the same result much faster. A value of 100 compacts nothing. Add --dry-run if you want to see what it would do, and --progress when the repository is big, because the run can take a while.
Order matters in a retention job: prune first, then compact. A nightly script would look like this, with your own keep rules:
borg prune -v --list --keep-daily=7 --keep-weekly=4 /path/to/repo
borg compact /path/to/repo
The caveat is time. The docs warn that depending on the number of segments that need compaction it may take a while, which is why they suggest --progress. Since it only pays off after archives were deleted, I would run it after a prune and not after every single backup.
Further reading: Borg docs: borg compact, Borg docs: borg prune