These two pseudo-elements serve typography details: the former applies to the "first line" of a rendered text block, and the latter to the "first character" of the text content. Both are typography-level pseudo-elements: they do not accept the content property, and styles are limited to a subset of allowed properties.
::first-line
The matched "first line" is a rendering result, recomputed as the container width changes, so it has no fixed number of characters.
Since flexbox was proposed in 2009, it has become the most elegant solution for one-dimensional layout, using the main axis and cross axis as its coordinates.
::first-letter
Matches the first character of the text content (skipping leading punctuation and whitespace), often used for the classic "drop cap" effect of newspaper typography.
Since flexbox was proposed in 2009, it has become the most elegant solution for one-dimensional layout: with the main axis and cross axis as its coordinates, the alignment and sizing of elements become predictable.
The drop cap at the start of this tutorial's body paragraphs is implemented with this very pair of pseudo-elements — every section opening you are reading quietly uses it.
Allowed Properties Are Limited
Because these two pseudo-elements are "typography-level" rather than "box-model-level" concepts, browsers only allow a limited set of properties on them:
Pseudo-element
Allowed properties
::first-line
Font, color, background, word-spacing, vertical-align and other text-related properties
::first-letter
All of the above plus float, margin, padding, border (because it can behave as an independent box)
NoteSetting width / height has no effect on ::first-line; for ::first-letter, width and height related properties only take effect after float or display: inline-block is set.