Nothing to do with marketing or magic, it is just that the devices are binary devices with the memory layed out in powers of 2, and if you use decimal (10 isn't a power of 2) to do the maths then you end up with nasty numbers (1024) which we then round down and divide into nice numbers (1), and then do more maths using the nice numbers which inevitably has rounding errors in the result!
In decimal:
1024 x 1024 x 1024 = 1,073,741,824 = 1GB
And in binary the exact same sum is:
10000000000 x 10000000000 x 10000000000 = 1000000000000000000000000000000 = 1GB
Or in a more compact format of decimal:
2¹º x 2¹º x 2¹º = 2³º
If the culture that developed our counting system had decided to only use fingers for counting, instead of fingers and thumbs, then 1GB would have been a nice number: 10000000000 = 10¹² = 1GB in octal. https://en.wikipedia.org/wiki/Octal#By_Europeans