Where did the formation of agency come from?

Federal agencies in the United States are typically formed by the President by Executive Order. The heads of these agencies become members of the President's cabinet.