In more detail
The input is read 3 bytes (24 bits) at a time and split into four 6-bit groups, each picked from the 64-character alphabet. Every 3 bytes become 4 characters, so the output is about a third larger, padded with = when the last group is short. MIME email adds a line break every 76 characters, which pushes the overhead to about 37%. A URL-safe variant (Base64url) uses - and _ instead of + and / and often omits the padding. See How Base64 and Encoding Work.
Why it matters
It appears in email attachments, data: URLs, HTTP Basic authentication headers and JWTs. Decoding fails or returns garbage when the variants are mixed, padding is stripped, or a + was turned into a space by a URL. And because it is reversible by anyone, a Base64 string in a config file or token is effectively plain text.
Example
Man is the bits 01001101 01100001 01101110. Regrouped in sixes they are 19, 22, 5 and 46, which map to T, W, F and u: TWFu. With one byte less, Ma becomes TWE=, and M alone becomes TQ==.
Common confusion
Base64 is encoding, not Encryption: there is no key, and anyone can decode it.