You're right, typically you cannot improve all aspects at once, there are usually tradeoffs. It appears that Bluetooth 5 increases the data rate and range, but not necessarily at the same time:
Bluetooth 5 introduced significant changes at the physical (PHY) layer for Bluetooth radio operation. Four data rates are now available 2Mbps, 1Mbps, 500kbps and 125kbps. The 2Mbps clearly offers higher throughput possibilities. Why offer lower datarates of 500kbps and 125kbps some may ask. The reason for these is that at these lower datarates and with the associated LE Coded processing using Forward Error Correction (FEC) it becomes easier to retirieve data transmissions in surrounding noise. In short, the sensitivity improves, specifically by around 12dB.
Link budgets can be improved by additional power, but critically the long range improvements in Bluetooth 5 do not rely on improved output power and mean up to four times more range can be achieved without a need to increase peak output power. The data throughput capacity does of course reduce when 500kbps or 125kbps modes are selected, but for many Bluetooth low energy applications which are relatively straightforward sensing and actuating applications, these data rates are perfectly adequate.
That is, when the signal is strong, the data rate can hit 2Mbps, but if it signal gets weaker, it can continue functioning at reduced rates at a longer distance than older versions allowed.