As far as I understand nature of your question there's 2 main things we have to point out:
how to think about ::before and ::after pseudo-elements
These pseudo-elements are not getting put before or after element they refer to. Nor in time manner (so it's not getting rendered before or later) nor in spacial manner (not in-front/behind or before/after). ::before and ::after pseudo-elements are children of element they refer to. ::before is a first child, inserted before all other, and ::after is the last child, inserted after all other children. It's a very important concept about pseudo-elements we need to remember.
what is content?
I'll lean on W3C documentation with that.
User Agents are expected to support this property on all media, including non-visual ones.
The content property dictates what is rendered inside an element or pseudo-element.
For elements, it has only one purpose: specifying that the element renders as normal, or replacing the element with an image (and possibly some associated "alt text").
For pseudo-elements and margin boxes, it is more powerful. It controls whether the element renders at all, can replace the element with an image, or replace it with arbitrary inline content (text and images).
Your way of thinking, that it's because of some problem we had to solve, may be close to the real answer. That's probably connected to what user agents/browsers needed to render any element and that's why it's obligatory to add content: ''
to pseudo-elements to render it at all. With other elements with no visible content like <div></div>
it's done automatically so we could use it to our own purpose, even with no visible content but with styles applied to it.