What was the purpose for the invasion during World War 2?

Be more specific. The German invasion of their neighbors or the Allies invasion of Germany.