You have to hand in your passport at BAMF if you apply for asylum. They will forward it to Ausländerbehörde that will keep it until further notice. You usually get your passport back after your asylum procedure is over or if you leave the country.