Non-German here. What’s the point of this setup? I guess in some ways this isn’t too different than USPS, which is self-sufficient and doesn’t face tax dollars nor give its profits to the Treasury, but in our case they didn’t bother going as far to separate it as it sounds like DB did.
It is typically midway to full privatisation. It goes from being a public company (not as in publicly traded but actually of public interest) to being for-profit company but state owning all the shares. Then the state sells the majority of the shares and it becomes actually private.
Typically, on the way, there is also a separation between the "good piece" and the "bad piece" of the company, ie the company that operates the trains (and makes profit out of the passengers etc) and the one that maintains the infrastructure. The state then can sell the profit-generating part of the company to the private sector, and continue operating the non-profitable one itself, so the private capital can enjoy the best of both worlds (having a privatised train company, but still having the state eat up the economic burden of maintaining the infrastructure that the former operates on). Not sure where germany stands in this roadmap, but this is what has happened in other places (and no it did not improve the experience of passengers to any degree).
The plan was to sell the DB after privatizing but something (if I remember correct financial crisis 2008) went between it so they (politics) decided to keep the stocks.
After reunification there were two railway companies, and they got reorganized into an AG. At least later, when they restructured the company into a holding and subsidaries, they planned to privatize them completely and disolve the parent company. They never did go through with that however.