Measurements are all originally based on some arbitrary decision, though usually based on something common and known, such as a hand, a foot, an arm length or whatever.
Different measurements for similar concepts were thus developed in different cultures and places. This applied to weight, distance, length, breadth, height, volume and so on.
Over time and probably to not a little influence of the need to standardise terms for scientific communication & trading, those who were geographically, politically or in some other way commonly united tended to adopt what was considered the most convenient or accurate determination of various measurements.
Two major types of measurement came to dominate across the World: Metric and Imperial. The Metric system is most commonly deemed to have originated in France but there are also claims for it to have originated elsewhere, including even England. What is agreed is that it came about in the mid 18th Century and soon was adopted across most of Europe as well as in other areas of the World.
The Imperial system was introduced in England in the early 19th Century, by law, and was designed to specifically define various measures in use at the time so that standardisation was achieved.
The Imperial system was used particularly in Britain and the USA but when the UK joined the Common Market in the 1970's, (sunsequently the EU), it also changed to the Metric system, as did other countries in the British Commonwealth.
For whatever reason, the USA chose to continue to use its own version of the Imperial system which, although most if not all name designations are the same, does have some differences in regard to the amounts defined by those designations.
The British Imperial gallon, for instance is equal to approximately 1.2 US Gallons. The reasonf for this can be found by extrapolating from the Magna Carta of 1215! Such is the extraordinary story of weights and measures. I'm sure that someone must have already written a definitive book on the topic. If not, there is a ready & interesting topic for someone.