Historically - A "godfather" (or "godmother") is somebody who takes responsibility for being the child's benefactor. The person would be responsible for seeing the child received a good education or apprenticeship, including religious upbringing. > Part of that responsibility, was to take over as the child's guardian if the parents died.
Godparents are usually someone in the family or close friends appointed by a child's parents. If something ever happens to the biological parents (like death), then the Godparents step in and play the role as the child's parents. They're kinda like a second set of parents, even while the biological parents are still alive and able to take care of their child.