What Base64 is for
Base64 turns arbitrary bytes into plain ASCII text using 64 printable characters, which is why it shows up in email attachments, data URLs embedded in CSS/HTML, and API payloads. It is an encoding, not encryption - anyone can decode it back instantly, so it should never be used to protect secrets.
Why Base64 exists in the first place
Many older systems and text-based protocols (like email) were only designed to reliably carry plain printable text, not arbitrary binary data - Base64 solves that by representing any byte sequence using only 64 safe, printable characters, which is why formats built around moving binary data through text-only channels (email attachments, data URLs, many API payloads) rely on it.
Why Base64 provides zero confidentiality despite looking like scrambled text
Encoding and encryption solve different problems: encoding (like Base64) transforms data into a different representation using a fixed, publicly known rule with no secret key involved, while encryption requires a key to reverse. Anyone - a person or a program - can decode Base64 back to its original form instantly with no special knowledge required, which is exactly why it must never be used as a way to hide or protect sensitive information.
Why encoding text first converts it to UTF-8 bytes
Base64 only operates on raw bytes, and a character like an emoji or an accented letter is represented by more than one byte in UTF-8 - converting text to its UTF-8 byte representation before encoding (and reversing that conversion after decoding) is what makes multi-byte characters round-trip correctly rather than coming out garbled.