The authority, exactly
§ 71 AufenthG splits it: the German mission responsible for your place of residence is competent for the visa you travel on, and the Ausländerbehörde is competent for the permit itself once you are in Germany. If you intend to start work in Germany you have to apply for the visa with the competent mission before entering.