Fraction to decimal: divide the numerator by the denominator
A fraction is already a division waiting to happen. For 3/4, dividing 3 ÷ 4 gives 0.75. For 5/8, dividing 5 ÷ 8 gives 0.625. Both divisions terminate — they reach a remainder of zero after a few digits — so the decimal form is exact.
When the division doesn't end: repeating decimals
Not every fraction divides evenly. 1/3 is 1 ÷ 3, which produces an endless string of 3s: 0.333333... For 2/3, it's an endless string of 6s: 0.666666... Since a screen can't display infinitely many digits, these are shown truncated to a fixed number of decimal places — 0.33333333 and 0.66666667 — rather than with a repeating-digit notation like a bar over the repeating digit.
Decimal to fraction: reading off the place value
Going the other direction starts from the decimal's place value. 0.75 has two digits after the decimal point, so it's 75 hundredths, or 75/100 — which simplifies to 3/4. Likewise 0.625 has three digits after the point, so it's 625/1000, which simplifies to 5/8. Both round-trip back to the exact fraction they came from, because both are terminating decimals.
Why converting a repeating decimal back doesn't return the original fraction
Typing 1/3's decimal form back in doesn't work the same way, because there's no way to type infinitely many 3s. Entering 0.333333333 (nine 3s) as a decimal and converting it to a fraction gives 333333333/1000000000 — not 1/3. The result is already in lowest terms (the two numbers share no common factor), so it isn't a simplification bug; it's simply the exact fraction for the finite digits that were actually typed, which is a slightly different number than the true, infinitely-repeating 1/3.