If a baby only has one kidney, what happened to the other kidney?

Maldevelopment. Kidneys like any other organ can have congenital abnormalities ranging from partial development, mal positioning of lack of separation from the other kidney or simply no development on one side. Nature is not "always perfect".