There are 8 pints in a gallon in both the imperial and US systems. But the units themselves differ: a US pint is 473 ml and an imperial pint is 568 ml, so a US gallon is about 3.79 litres against the imperial 4.55. The ratio is the same; the sizes are not.
The core difference
Both are volume units, and both exist in two incompatible versions.
- pint — 568 ml imperial; 473 ml US.
- gallon — 4.55 litres imperial; 3.79 litres US.
- ratio — 8 pints to the gallon in both systems.
Why two systems
The US kept older English measures that Britain later revised. Britain standardised the imperial gallon in 1824 on the volume of ten pounds of water; the US had already adopted the earlier wine gallon. Neither side has changed since, which is why a British pint of beer is noticeably larger than an American one.
Where each is still used
The UK still sells draught beer and milk in pints by law, while most other goods are metric. The US uses both units routinely. Getting a recipe wrong across the two systems introduces roughly a 20% error, which matters most in baking.