How the Department of Homeland Security established

How and why was the Department of Homeland Security established? What is the organizational structure of DHS?