The airlines must obtain passport details in advance of travel but only for certain countries whose governments have made that a rule. Usually the airlines require this information (if appropriate) at the point of ticket sale or else at check-in. If it is required for your destination then you will either not be able to buy a ticket or else check in online without providing it - you will be prompted to enter it. If you check in at the counter then the member of staff will copy it from your passport which you will in any case be asked to present. I think I am correct (but not quite certain) that this information is not required in advance by Germany.