I wrote a script (
https://github.com/osmarks/random-stuff/blob/master/histrete...) to dump a Firefox places.sqlite database to a separate SQLite database for long-term storage (I run it nightly). It seems to delete stuff based on some combination of visit frequency and last visit time.
I suspect they need to do this to keep history searches fast, since I also separately hacked a bunch of `about:config` options to retain more history and they run quite slowly now, particularly on my phone.