Also called Betriebskosten. You pay a monthly advance, the Nebenkostenvorauszahlung, and once a year the landlord produces a statement reconciling what you paid against what the building actually spent. If you underpaid you owe the difference; if you overpaid you get it back. A cold winter can produce a bill of several hundred euros arriving a year after the fact.
What can legally be passed on is a defined list — heating, water, drainage, lift, street cleaning, rubbish, building insurance, caretaker, communal electricity, and a few others. Repairs and the landlord's own administration are not on it, which is worth knowing if you ever read a statement that seems to include a new boiler.
For a subletter this is mostly somebody else's problem, and that is the useful thing to understand: on a three-month sublet the annual reconciliation will land long after you have gone, and it lands on the main tenant. You are paying them a share of their monthly advance, not entering the accounting yourself. It is one of the genuine simplicities of subletting.
It becomes your problem in one case — a long sublet with a written agreement that makes you liable for the reconciliation. If a contract mentions Nachzahlung or an annual settlement, understand what you are agreeing to before signing, because the figure is not knowable in advance.