If you understand math, look up the Equal Temperament maths. Basically it creates a geometrically (not linearly) evenly spaced set of 12 ratios between 1:1 and 1:2 (unison to octave), so you will see there is a division by 12, exponentials, and 2 for the octave. This makes a mathematical model that allows the intervals to work in any key because the spacings are geometrically equal.
The 12 real ratios based on actual study of harmonics are not geometrically equally spaced, so you get a different set of frequencies for each seed note or root. Its only a few hertz but enough to hear. So with the real ratios you need different fret spacings for each key effectively, and changing key inside a piece is close to impossible. The 12 ratios are embodied in the Pythagoean Temperament of the so called "perfect" intervals. They are perfect because they sound so good.
When you play your ukulele, assuming it is well built and set up properly, you often correct the difference between Equal Temperament and the perfect intervals (often called "error") by your fretting technique, subconsciously without ever being told about it, because it is only a few Hz which are not hard to get with technique.
The source of the 12 perfect intervals or ratios is a thing called the Harmonic Series or Musical Series. This is a linear series generating by adding a frequency to create a series of harmonics. In the theory discussions it is started at C and is shown in Standard Notation, which is confusing to the math minded folk. This is how the series goes: F 2F 3F 4F 5F 6F ....... So for maths if you start at A1 (using Scientific Pitch Notation (SPN)) =55hz you can get a linear series in Hz: 55 110 220 440 880 1760 ... just keep adding 55 and you get the series. If you take this series out to about 20 harmonics IE 20F, and look at the ratios to the root note (A1 = 55hz in this case) in Hz, you will find there are 12 ratios that keep recurrng, and they are between 1:1 and 1:2, or unison to octave. This is the source of the Perfect Intervals. The physics is that they generate harmonics that sound good in relation to the root frequency, this is a real gift from the universe, it works for any frequency. If you read the history of the Temperaments you will get a sort of time lapse development of these ratios into useful intervals for music. Start with Pythagorus. Also they are not all simple ratios like 3:2 or 4:3, some of them are like 1024/729. Look up the tables for Pythagorean Temperament to see how you get to 1024/729. Find the discussion of the history of stuff like Bb and B, development of Melodic Minor scales. Human geniuses have taken these natural ratios and turned them into mathematical models so that musical instruments can be designed and built, firstly in a feasible size and shape, and then so they can accompany other instruments. They did this maybe in the 1800s a long time ago, now it all seems to be what has always been. Eastern cultures have also developed Temperaments and instruments, they may use 24 ratios or intervals, but if you analyse the math, they assign frequencies to notes based on ratios between 1:1 and 1:2, many come from centuries of trial and error, and not maths.
No doubt I have made some errors in history, and there is no way to confirm some of the statements above, but if you want to understand Temperaments and real sinusoidal harmonics applied to music, the discussion may help you. A mistake is to use this information as the absolute truth and get too involved in arguing the accuracy, instead of focussing on using the discussion to learn about music and apply knowledge of temperaments and scales to being a creative musician. Non-creatives will get carried away with the history. Creatives will use the discussion to create creative music.