If you invest $1M with a 2x liquidation preference, the valuation doesn't matter. You're guaranteed $1M back no matter what. If it's a home run, you still get the upside.
When you get a 2x liquidation preference, you can afford to invest at a much higher valuation than the "real" valuation of $5M, because your downside is limited, and you get a greater share of any upside (especially if you got participating preferred). Even on a fire sale for $2M, you still got a 100% return on your investment. Instead of selling $1M of common shares at a valuation of $5M, they can raise $1M of 2x preferred at a valuation of $10M-$20M+.
A lot of these valuations are funny money, because the headline doesn't mention the preferences given to the investment. If they were selling common shares, it'd be a much lower valuation.