one general point
This answer won't cover the situation at any German university and can't reflect all possible variations of PhD programs, due they can strongly vary from university to university. There is (in exception to the rest of this over-regulated national state) no regulation or law about how universities have to offer PhD programs. They are free to decide what to expect from a doctoral candidate. This also means, that offering external doctorates is optional for the universities, there exists no legal claim to force a university to accept external candidates.
Usually in an internal doctoral study you are affiliated with the university as a kind of assistant of your supervising professor inside the so called "Mittelbau" (translation via dict.cc: non-professorial teaching staff). This means the university may expect you to work in a laboratory or teaching (e.g. holding seminars for in substitute to your supervisor). As @Aeismail pointed out this is mostly connected with a labor contract with the professorial chair or an institute. To reflect @O.R. Mapper's comments: I do not mean that someone becomes the professors lapdog.
One problem I experienced: It's difficult to join such a "Mittelbau" position as a person from outside a given university. These staff positions are particularly founded by third party (e.g. industry) funding and particularly from the public foundation of the (state-)university. In result the expectation toward the professorial chairs or institutes often is to fill open positions with own graduates/alumni. Some universities try to privilege internal candidates to "breed" their own scientific juniors with any legal option they find.
As @DCTLib pointed out in his/her comment: The universities know their own (master-) students better: their working performance, interests and so on. Compared to unknown external candidates this is less obvious. For a board committee it's harder to evaluate someones value for an internal university staff position compared to an alumnus that is well known.
Another factor is that the funds run out at some point of time. One external (even foreign) applicant could fit well into a research project that enables funding of a doctoral position, in case his research field and experiences match the needs of an open position. In such a situation the chances to be employed as a candidate from outside the university may rise.
external = more personal responsibility
The track of an external doctoral study leaves you alone in some points:
Some universities will expect a doctoral candidate to prove teaching experience. As an external candidate you're not involved in the university teaching, so you need to provide proof of teaching skills in another way.
funding: You have no labor contract with the university, so you have to find another way to cover your living expenses, conference fees, travel & accommodation for yourself. Scholarships can be one way, but difficult to gain as long as you and your topic are unknown to the scientific community.
matriculation optional: You may not need (in some cases you won't be allowed) to matriculate at the university in an external doctorate. Without matriculation you cannot benefit from a student's status (public travel, discounts e.g. for conference fees). With a current matriculation you cannot receive German social transfer benefits in case you get unemployed during your doctoral phase (if you are a valid to receive them at all...).
internal = often more structure
A lot of universities offer structured graduation programs available to the members of the "Mittelbau" (internal candidates). These programs include for example:
- workshops and tutorials (scientific writing, intercultural training, good scientific practice etc.)
- covering of conference costs (fees, accomodation, travel expenses)
- summer schools (for international exchange)
The ideas this images tries to visualize are the following:
- internal candidates have less affiliation to their universities (maybe no affiliation with the exception of the mentoring of your doctor-father/mother)
- internal and external (here called affiliation) and structuredness are like two dimensions of doctoral programs
- most internal candidates join a structured program (but not all)
- most external candidates work more on their own like independent researchers