When a mother momentarily cannot raise her child herself but has an expectation that her situation might change, she can entrust foster parents with her child. They will take care of the child until the mother is ready to take her child home and take care of it herself.
In the meantime the mother stays in contact with the child through regular visits. Foster parents are placed by the youth welfare offices.
Please find more information here (in German):
Please find more information here (in English):