How does the German voting system work?

Each voter has two votes. The first vote is for a direct constituency candidate. The candidate with the relative majority receives a guaranteed seat in parliament. The second vote is for a party's list of candidates, which applies at the state level. The second vote determines the overall proportional party representation in the parliament. Overhang seats might be added to satisfy the direct mandates from the first vote.